According to the computer language benchmark game, the LuaJIT implementation seems to beat every other JIT-ed dynamic language (V8, Tracemonkey, PLT Scheme, Erlang HIPE) by an order of magnitude.
I know that these benchmarks are not representative (as they say: "Which programming language implementations have the fastest benchmark programs?"), but this is still really impressive.
In practice, is it really the case? Someone have tested that Lua implementation?
LuaJIT uses advanced compilation techniques, and it also has a very finely engineered implementation. For example, when the fancy compilation techniques can't handle a piece of code, LuaJIT falls back to an very fast interpreter written in x86 assembly.
It can only be as fast as C, but is more likely to be slower. It can't be faster than the language of its own implementation. As long as the C code is fully optimized and uses the most appropriate algorithms. Poorly written C code can certainly be slower than well written LUA code.
LuaJIT is a Just-In-Time Compiler (JIT) for the Lua programming language. Lua is a powerful, dynamic and light-weight programming language. It may be embedded or used as a general-purpose, stand-alone language.
Lua is fast Several benchmarks show Lua as the fastest language in the realm of interpreted scripting languages. Lua is fast not only in fine-tuned benchmark programs, but in real life too. Substantial fractions of large applications have been written in Lua.
There's a good discussion at Lambda the Ultimate. LuaJIT is very good.
Many people have reported impressive speedups on lua-l (the lua mailing list). The speedups are most impressive for pure Lua code; the trace compiler is not as effective when there are lots of calls to C functions in loadable library modules.
In my case (a game prototype development), I observed no performance improvement at all. I use lua for embedding, so there are lots of calls to C++ library functions. Even though main loop is in a lua script and all of the important logic is implemented in lua, the overall performance was determined by rendering engines and physics engines implemented in C++. The original lua is already fast enough for such applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With