lua-users home
lua-l archive

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


Zed Shaw wrote:
One thing I have noticed is that the Lua compiler (in both 4 and 5) produces inefficient code. It has redundant opcodes, unnecessary variable copying and other things. I'm curious if anyone has attempted to add optimization to the process or if they think it would be useless?

I get the general impression that Lua's code generation is optimized
for speed of compilation (very fast!) as much as speed of resulting
code.  I'd be interested to hear examples of redundant opcodes, if
there is any pattern to such, since they'd be obvious candidates
for a cheap peephole optimization (I'm sure I remember reading that
Lua already does some peephole optimizations, but I can't find
[ummm, grep] anything obviously pertinant in the source).

Regards,
--Adam
--
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3
"Responsible parents don't raise kids in West Virginia."