lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

Brent Fulgham wrote:
> For another take on this topic, consider http:// 
> shootout.alioth.debian.org/.  In my tests, Lua is faster than Python  
> and Perl in almost every category.  The places where it is slower, is  
> probably due to poor Lua test implementations, an not Lua itself.

Well, since I wrote (or tuned) all of the Lua benchmarks, I'm
pretty sure there is very little room left for improvement.
But, everyone, surprise me, _please_. [Please verify that your
implementation is really faster before submitting it, though.]

The cases where other interpreted languages are faster, is when
the main part of the problem can be delegated to some C library
function. None of the Lua benchmarks use any other than the
(deliberately very few) built-in Lua library functions.

Case in point #1: pidigits requires a big-number math library.
The Lua implementation does all of this in pure Lua code. Most
other languages link to GMP (using hand-tuned assembler code).
I plead guilty -- I wrote the C benchmark using GMP and it has
been cloned a lot. So far I've resisted the temptation to submit
a variant for the Lua/GMP binding. It's really a rather pointless
benchmark by now.

Case in point #2: reverse-complement requires fast char-to-char
translation and in-place reversal of huge strings. An interpreted
language wins on this benchmark if it has such a C function in
its standard library.

[ I'm perfectly well aware that the weights of the benchmarks can
be tuned to match one's own usage scenario. But I'm pretty sure
that very few people would even bother to do so before coming to
a conclusion. ]

Don't get me wrong: IMHO the shootout is still the best
cross-language benchmark comparison site. Interpreting the
results is the real black art. ;-)

Bye,
     Mike