4 ms·
Since someone mentioned it, how slower is PUC Lua in respect to LuaJIT? Compromisingly slower? Are there metrics out there or is it a relatively subjective feel
by kensai 10y ago
Since someone mentioned it, how slower is PUC Lua in respect to LuaJIT? Compromisingly slower? Are there metrics out there or is it a relatively subjective feeling?
- justincormack 10y agoPUC lua is probably the fastest traditional scripting language. LuaJIT is much faster, in particular if you are interfacing with C, as the ffi has zero overhead, while the traditional Lua API is relatively slow. Also the performance is noticeable if you are doing a lot of work in the language too, generally as fast as C code for many use cases if you tune the code.
- petre 10y ago> PUC lua is probably the fastest traditional scripting language That really depends what you are testing for. For string ops is not the fastest. For recursive Fibonacci (inefficient) LuaJIT is faster than D and Lua is faster than Perl. http://raid6.com.au/~onlyjob/posts/arena/ http://raid6.com.au/~onlyjob/posts/arena/
- daurnimator 10y agoSee http://luajit.org/performance_x86.html http://luajit.org/performance_x86.html Though luajit has gotten even more optimisations since that was done. That said, I rarely find my code's performance is the bottleneck, and don't benefit from luajit. The guys that do are doing scientific computing (e.g. torch) or high performance networking (e.g. snabb)
- CrLf 10y agoI've been involved in a project where we used LuaJIT. At some point we discovered that a bug in our build process was making it pick up PUC Lua (from the system-installed packages) rather than LuaJIT (from the build process itself). This went under the radar for a while even though we had tons of traffic. Turns out PUC Lua is pretty fast on its own.
- bakery2k 10y agoIn my experience (doing some fairly heavy computation in nested loops), PUC Lua is faster than Python but slower than recent versions of Ruby. LuaJIT is at least 10x faster than all three.
- jnbiche 10y ago> PUC Lua is faster than Python but slower than recent versions of Ruby Ruby faster than PUC Lua? That doesn't sound right. You're talking about Ruby MRI?
- bakery2k 10y agoYou're talking about Ruby MRI? Not the original MRI, but YARV. For this particular program, the performance of different language interpreters is: MRI (Ruby 1.8) < CPython 3.5 < CPython 2.7, PUC Lua 5.1/5.3 < YARV (Ruby 1.9/2.3) < LuaJIT -joff There is a factor of ~5x between the slowest and fastest of these interpreters. LuaJIT with the JIT enabled is ~10x faster than even its own interpreter.
- etiene 10y agoDoesn't that also use a JIT? Why are you comparing benchmarks versus PUC Lua instead of versus LuaJIT??
- bakery2k 10y agoDoesn't that also use a JIT? YARV? No. YARV is the current official Ruby interpreter - it replaced MRI in this role from Ruby 1.9 onwards.
- etiene 10y agoWeird... Sasada's presentation mentions a JIT, which is why I was confused. (http://www.atdot.net/yarv/rc2006_sasada_yarv_on_rails.pdf http://www.atdot.net/yarv/rc2006_sasada_yarv_on_rails.pdf page 15)