lua-users home
lua-l archive

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


On 2010-08-29, Joe Finn <warriorjoe118@gmail.com> wrote:
> Based on my experience with Java JIT, and without detailed knowledge of Lua
> JIT, I think the JIT probably produces much less efficient code than the C
> compiler for the same "script". That's just the nature of JITs -- they don't
> have a lot of time to do their job, the user is waiting while they compile,
> so they must be **FAST**.

This is a very strong statement which is not generally true.
Yes, indeed, an off-line compiler has more time to optimize that a JIT
but off-line compiler does it at compile-time and is, thus, deprived
of the actual run-time analysis. A certain control flow through a
program can use some optimizations which will not be true in general
for other flows in  the same program. I am sure one can come up with
some scenarios when through a run-time knowledge a JIT will beat an
off-line non-real-time compiler.

--Leo--