[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Optimizing off-line Lua compiler
- From: Rici Lake <lua@...>
- Date: Wed, 27 Apr 2005 10:18:26 -0500
On 27-Apr-05, at 10:05 AM, Luiz Henrique de Figueiredo wrote:
Peephole-optimisation might be a goer -- I assume there would be some
level of redundancy in the generated byte-code. But this is really
something that could be applied to the lua.lib portion anyway I'd
-- but considering it was stripped from lua5 because it was becoming
difficult to maintain?
Actually, all optimizations done by luac in 4.0 are done by the parser
The one little optimization which might make a fun project for someone
is the common idiom:
a and b or c
where b is a constant.
Currently, the compiler generates a redundant check on b (redundant if
b is constant, anyway).
Of course an actual ternary operator could be optimised even better,
since the intent was probably a ? b : c in the first place. But I'm not