Hacker News new | past | comments | ask | show | jobs | submit login

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?



See 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)


I'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.


PUC 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.


> 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/


In 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.


> 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?


You'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.


Wow, I'm not a Rubyist, so I had no idea about this. You all not only developed a faster, compliant interpreter, but Matz actually replaced MRI with an interpreter developed by a third-party as the reference Ruby interpreter? Huge props to him and the Ruby community for that.

Unfortunately, as a Pythonista (although one whose paid work is mostly in JS these days), I can't imagine that happening in the Python community (not to our credit). Too much ego wrapped up in CPython.


Doesn't that also use a JIT? Why are you comparing benchmarks versus PUC Lua instead of versus LuaJIT??


Doesn'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.


Weird... Sasada's presentation mentions a JIT, which is why I was confused.

(http://www.atdot.net/yarv/rc2006_sasada_yarv_on_rails.pdf page 15)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: