Lua is faster than Fortran???
bart.c
bartc at freeuk.com
Sun Jul 4 10:47:31 EDT 2010
"sturlamolden" <sturlamolden at yahoo.no> wrote in message
news:daa07acb-d525-4e32-91f0-16490027cc42 at w12g2000yqj.googlegroups.com...
>
> I was just looking at Debian's benchmarks. It seems LuaJIT is now (on
> median) beating Intel Fortran!
>
> C (gcc) is running the benchmarks faster by less than a factor of two.
> Consider that Lua is a dynamically typed scripting language very
> similar to Python.
>
> LuaJIT also runs the benchmarks faster than Java 6 server, OCaml, and
> SBCL.
>
> I know it's "just a benchmark" but this has to count as insanely
> impressive. Beating Intel Fortran with a dynamic scripting language,
> how is that even possible? And what about all those arguments that
> dynamic languages "have to be slow"?
>
> If this keeps up we'll need a Python to Lua bytecode compiler very
> soon. And LuaJIT 2 is rumoured to be much faster than the current...
>
> Looking at median runtimes, here is what I got:
>
> gcc 1.10
>
> LuaJIT 1.96
>
> Java 6 -server 2.13
> Intel Fortran 2.18
> OCaml 3.41
> SBCL 3.66
>
> JavaScript V8 7.57
>
> PyPy 31.5
> CPython 64.6
> Perl 67.2
> Ruby 1.9 71.1
>
> The only comfort for CPython is that Ruby and Perl did even worse.
I didn't see the same figures; LuaJIT seem to be 4-5 times as slow as one of
the C's, on average. Some benchmarks were slower than that.
But I've done my own brief tests and I was quite impressed with LuaJIT which
seemed to outperform C on some tests.
I'm developing my own language and LuaJIT is a new standard to beat for this
type of language. However, Lua is quite a lightweight language with
minimalist data types, it doesn't suit everybody.
I suspect also the Lua JIT compiler optimises some of the dynamicism out of
the language (where it can see, for example, that something is always going
to be a number, and Lua only has one numeric type with a fixed range), so
that must be a big help.
--
Bartc
More information about the Python-list
mailing list