lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I was playing with different methods of portable opcode dispatch over
the weekend and whipped up this simple patch to lua after some
experimentation in a vacuum.  The basic premise is to waste a few
cycles on each dispatch in an attempt to give a common superscalar
processors branch predictor a little extra food for thought. There are
currently 3-11 comparisons pre-dispatch and that could probably be
pruned to 2-9 or so. It also bloats the interpreter by about 4k, but I
have seen a 1.5-28% performance increase in my limited benchmarking on
x86 hardware. It should also meet lua's portability needs, although it
would probably need to be conditionalized as the extra work would just
be a slowdown on some arch's.

I'm not sure if this is useful or not in lua's grand scheme, but I
thought I would throw it out there.