lua-users home
lua-l archive

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


Hi Mike,

> You should also consider the size of scripting engine you're
> embedding and how easy it is to bind to it. Lua and LuaJIT are
> more than ten times smaller than V8 and IMHO much easier to embed.

[JCT] Yes that is certainly a consideration.
 
> > Does anyone know a performance comparison of JIT'ed Lua versus
> something
> > like V8 JavaScript?
> 
> Well, we can find out ... so I fetched today's V8 trunk and ran
> some standard benchmarks. Unfortunately the V8 standalone shell is
> very limited and is unable to run quite a few of them. And there's
> no JavaScript translation for some others. :-(
> 
> All ratios are normalized relative to the performance of the
> standard Lua interpreter. E.g. 5.0 means something is five times
> faster than Lua. Higher numbers are better:
> 
>              |  Lua |  V8* |  LJ1 |  LJ2 |  GCC
> -------------+------+------+-------------+------
> mandelbrot   |  1.0 |  0.9 |  5.8 | 12.6 | 15.4
> fasta        |  1.0 |  1.1 |  2.8 |  4.0 | 13.3
> partialsums  |  1.0 |  1.4 |  3.8 |  4.2 |  2.2
> spectralnorm |  1.0 |  2.9 |  3.1 | 19.8 | 18.5
> nbody        |  1.0 |  3.0 |  5.0 | 15.3 | 33.0
> nsieve       |  1.0 |  4.1 |  2.2 |  4.7 | 27.3
> nsievebits   |  1.0 |  5.7 |  5.2 | 31.6 | 56.0
> recursive    |  1.0 |  6.8 |  6.3 |  3.0~| 33.1
> fannkuch     |  1.0 |  6.8 |  7.3 | 21.4 | 34.6
> binarytrees  |  1.0 |  8.1 |  1.6 |  3.0~| 11.0

[JCT] Thanks very much for this very helpful comparison.  I am surprised
that LJ2 actually beats GCC on some tests.

> Not suprisingly, Lua and LuaJIT still have the lead on numeric
> benchmarks (unboxed floating point numbers pay off here). And
> LuaJIT 2.x will completely change the game (sorry, still no ETA).

[JCT] LJ2 looks positively awesome on those numbers.
 
> But as others have said: please compare the different VMs with
> benchmarks that best match *your* performance needs.

[JCT] Yes, this is true and I intend to do that.  I just wanted to get some
ballpark feel for the relative speeds and you have provided that info so
thanks again.

John