7 ms·
"LuaJIT's interpreter () beats V8's JIT compiler" - Mike Pall
- olliej 17y agoOne question i have regarding these is how fair are the tests, a very quick look at the tests shows for "pidigits" the lua code has the line: require"c-gmp"(g, aux) Implying that it is using the GNU Multiprecision Library for it's big integer support, whereas the JS code has: load('/home/dunham/shootout/bench/Include/javascript/biginteger.js'); Which is apparently a big integer library implemented in javascript http://www-cs-students.stanford.edu/~tjw/jsbn/ http://www-cs-students.stanford.edu/~tjw/jsbn/ In other words, in at least one of the tests a comparison is being made between javascript and C/C++, not javascript and Lua.
- olliej 17y agoI have looked at a few of the other tests and nothing obviously pops out as being bogus, so it's likely just this pidigits test which has an unfair advantage
- tumult 17y agoV8 is implemented in C++, so should you count it as just a really bad C++ benchmark? The Lua benchmark uses features Lua can use. JavaScript does not have that feature. http://en.wikipedia.org/wiki/Turing_tarpit http://en.wikipedia.org/wiki/Turing_tarpit
- olliej 17y agoIf you're claiming that your interpreter is faster than someone elses you can't make your test depend on a native library for the bulk of the work. That may be a valid argument for "my language is better" but it isn't an argument for my interpreter is faster than yours.
- tumult 17y agoLanguage Shootout, not Interpreter Shootout. You're playing directly into the Turing tarpit.
- mikemike 17y agoActually reading the Lua mailing list post http://lua-users.org/lists/lua-l/2010-03/msg00305.html http://lua-users.org/lists/lua-l/2010-03/msg00305.html, referenced in the linked text might help: > For pidigits I'm comparing the pure JS and Lua programs, not the GMP bindings. I'm comparing these two: http://shootout.alioth.debian.org/u32/program.php?test=pidigits&lang=luajit&id=2 http://shootout.alioth.debian.org/u32/program.php?test=pidig... http://shootout.alioth.debian.org/u32/program.php?test=pidigits&lang=v8&id=1 http://shootout.alioth.debian.org/u32/program.php?test=pidig... Both are written in pure Lua and JavaScript and do not use a C binding.
- olliej 17y agoThe numbers you point to make use of http://shootout.alioth.debian.org/u32/program.php?test=pidigits&lang=luajit&id=5 http://shootout.alioth.debian.org/u32/program.php?test=pidig... Which is using GMP, so maybe that particular link needs to be updated?
- WALoeIII 17y agoThis is not an apples to apples comparison, the implemented Languages are fundamentally different. I do think this is an inspiring factoid that shows what is possible with a well done JIT. Go Rubinius!
- ardit33 17y agohow are they very different? Syntax aside, Lua and Javascript are actually pretty similar. I would say they actually are close cousins.
- deleted 17y ago[deleted]
- extension 17y agoIndeed, they are strikingly similar, one of the key differences being Lua's minimal/extensible dispatch. A function call, by default, involves no searching through superclasses/prototypes. This is likely a big advantage in benchmarks.
- xtho 17y agoWhich subclasses do you want to search through in JavaScript? That said to me lua seems a little bit like JavaScript's sane cousin.
- kinetik 17y agoThey really are quite different. Here's one example: http://lambda-the-ultimate.org/node/3851#comment-57751 http://lambda-the-ultimate.org/node/3851#comment-57751
- xtho 17y agoDefine "quite different".
- tumult 17y agoJavaScript has multiple critical blunders in its specification that offer no advantage to the programmer, but are very difficult to optimize.