100x smaller, multiple times faster and did it right from the beginning.
100x smaller, multiple times faster and did it right from the beginning.
This is an unsubstantiated claim. If LuaJIT was indeed multiple times faster on arbitrary code, everybody would be just running JS on something like LuaJIT in browsers :)
LuaJIT does spectacular job on loops, especially if you limit yourself to number crunching and FFI.
But if you code is polymorphic, makes heavy use of normal OOP and does not decompose into a graph of biased loops and linear traces V8 will pull ahead due to its method-compiler nature which is not susceptible to tracing pitfalls.
Here is an interesting example: there is an issue[1] "Metatable/__index specialization" in LuaJIT repository filed by Mike Pall himself, it's about adding infrastructure which would allow traces to make optimistic assumptions about metatable constness, because it would greatly improve the quality of traces produced from OOP heavy code. (Also this is precisely the limitation that is already imposed on FFI metatypes to allow JIT generate better code). The issue is still unimplemented in LuaJIT... However this is something that V8 could do for several years now, because it is extremely important for the kind of code people are writing in the real world.
That said LuaJIT is an impressive piece of software. Would love to know what Mike Pall is up to now.
The Lua ecosystem is very different than almost any other; It's primary use case, probably 95% of projects using it or more, is being embedded into another project for scripting/configuration/control. As such, it is common for projects to pick a version of Lua and stick with it, rather than upgrade to the latest-and-greatest-with-slight-to-major-incompatibilities. Pall liked 5.2, and thought 5.3 didn't offer enough to break compatibility.
You sure about that? In the alioth benchmarks, v8 wipes the floor with lua: http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
"If you're interested in something not shown on the benchmarks game website then please take the program source code and the measurement scripts and publish your own measurements."
Like this guy did -- https://pybenchmarks.org/u64q/which-programs-are-fastest.php