LuaJIT 2.0

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Star Crunch
Prole
Posts: 33
Joined: Sun Feb 15, 2009 12:13 am
Location: Monterrey, MX
Contact:

LuaJIT 2.0

Post by Star Crunch » Sat Oct 31, 2009 11:38 pm

This was posted about a half hour ago on the Lua mailing list:
Mike Pall wrote:It's almost midnight on Halloween here. This is the perfect time
to release long-awaited, almost mythical open source software ... ;-)

Yes, here it is: the first public release of LuaJIT 2.0!

Here is a link to the home page:
http://luajit.org/luajit.html

And a direct link to the download page:
http://luajit.org/download.html

What is LuaJIT?
---------------

LuaJIT is a Just-In-Time (JIT) Compiler for Lua. It's fully
compatible with standard Lua 5.1 and can significantly boost the
performance of your Lua programs.

LuaJIT is open source software, released under the MIT/X license.

LuaJIT builds out-of-the-box on all popular x86 operating systems
(Linux, Windows, OSX etc.). It runs fine as a 32 bit application
under x64-based systems, too.

This is a BETA TEST release -- the current status and the list of
known issues are shown here: http://luajit.org/status.html
Please report any problems you may find with this release. Thank you!

What's new in LuaJIT 2.0
------------------------

The VM of LuaJIT 2.0 has been rewritten from the ground up and is
relentlessly optimized for performance. It combines a high-speed
interpreter, written in assembler, with a state-of-the-art JIT compiler.

An innovative trace compiler is integrated with advanced, SSA-based
optimizations and a highly tuned code generation backend. This allows a
substantial reduction of the overhead associated with dynamic language
features. It's destined to break into the performance range
traditionally reserved for offline, static language compilers.

Performance on numerical code is already quite competitive (see below).
Support for other areas (e.g. string functions) is still a bit weak.
Although the VM supports all Lua language features and standard library
functions, the JIT compiler is not complete (yet) and falls back to the
interpreter in some cases. All of this works transparently, so unless
you use -jv, you'll probably never notice. The interpreter is quite
fast, too (near the performance of the LuaJIT 1.x JIT compiler).

Preliminary benchmark numbers are shown below -- performance will
likely improve during the beta test phase. These numbers are mainly
intended to give you an idea about the typical speedups you can expect,
depending on the type of application. Your mileage may vary.

Ok, so thanks to everyone for their patience! A big thank you goes to
the alpha testers. And now, please have fun with it -- Happy Halloween!

--Mike

Relative speedup over Lua 5.1.4 on standard Lua benchmarks
(e.g. 11.9 means it's almost twelve times faster):

md5 152.7 | mandelbrot 13.4 | nsieve 4.7 |
array3d 101.5 | pidigits 12.4 | partialsums 4.1 |
array 73.5 | random 12.2 | chameneos 3.8 |
methcall 28.8 | nsievebits 12.0 | recursive 3.5 |
nsievebits 28.0 | nestedloop 11.9 | knucleotide 3.4 |
matrix 23.0 | lists 9.3 | binarytrees 2.7 |
spectralnorm 21.4 | cheapconcr 5.5 | meteor 2.0 |
fannkuch 20.9 | cheapconcw 5.4 | revcomp 1.8 |
nbody 14.8 | fasta 5.3 | sumfile 1.5 |

SciMark scores on a 3 GHz Core2 E8400 (single-thread, not vectorized),
higher numbers are better:

SciMark composite |
small score | FFT SOR MC SPARSE LU
----------------------------+---------------------------------------
GCC 4.3.2 906.1 | 739.1 909.0 190.4 1057.0 1635.1
JVM 1.6 Server 876.3 | 573.8 1185.5 297.7 579.2 1745.4
JVM 1.6 Client 579.6 | 424.8 895.8 122.8 595.5 859.0
----------------------------+---------------------------------------
LuaJIT 2.0.0-beta1 580.4 | 427.4 1025.0 223.7 303.4 922.5
LuaJIT 1.1.5 96.7 | 72.0 166.1 37.1 91.8 116.5
Lua 5.1.4 16.5 | 11.0 27.4 7.6 16.9 19.5

Get the newest Lua SciMark here: http://luajit.org/download/scimark.lua
Maybe it doesn't matter so much now, but worth a look for 0.7.0. :)

I'm slowly putting together a prototype of something now, so I figure after I migrate
its stuff over to 0.6.0 I'll at least build this into it and experiment.

User avatar
Fizzadar
Prole
Posts: 30
Joined: Mon Oct 26, 2009 6:18 pm

Re: LuaJIT 2.0

Post by Fizzadar » Sat Oct 31, 2009 11:51 pm

Wow, that's brilliant! And I already thought Lua was fast :P

User avatar
subrime
Citizen
Posts: 76
Joined: Thu Nov 13, 2008 6:18 pm
Location: Australia

Re: LuaJIT 2.0

Post by subrime » Sun Nov 01, 2009 2:05 am

The fine print is quite clear: LuaJIT only works on x86 platforms (because of hand coded assembly).

If this becomes a part of LOVE, it will cut off a significant degree of compatibility...

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: LuaJIT 2.0

Post by Robin » Sun Nov 01, 2009 2:43 am

subrime wrote:If this becomes a part of LOVE, it will cut off a significant degree of compatibility...
The only way this could get into LÖVE then would be as something "optional", I guess.
Help us help you: attach a .love.

User avatar
subrime
Citizen
Posts: 76
Joined: Thu Nov 13, 2008 6:18 pm
Location: Australia

Re: LuaJIT 2.0

Post by subrime » Sun Nov 01, 2009 8:50 am

As far as love goes, it seems almost pointless.

Most of the time game speed is limited by the graphics, sound and physics - all of which are provided by precompiled external libraries (SDL, OpenAL, Box2d). LuaJIT gives no benefit at all to this situation.

For the tiny fraction of lua implemented game logic that might benefit from LuaJIT, there is already a way to speed it up with the new love.native facility.

User avatar
bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LuaJIT 2.0

Post by bartbes » Sun Nov 01, 2009 9:58 am

subrime wrote:with the new love.native facility.
Well, that has been removed because of lack of portability too..

daveberk
Prole
Posts: 3
Joined: Wed Oct 07, 2009 5:36 pm

Re: LuaJIT 2.0

Post by daveberk » Sun Nov 01, 2009 10:05 am

subrime wrote:The fine print is quite clear: LuaJIT only works on x86 platforms (because of hand coded assembly)
As of right now. But he does plan to port this to x64. He's currently looking for a sponsor, let's hope some large game company sponsor him...

Anyway, what's Love needs more than speed improvement right now, IMHO, is utf8 support.

User avatar
Sardtok
Party member
Posts: 108
Joined: Thu Feb 21, 2008 2:37 pm
Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
Contact:

Re: LuaJIT 2.0

Post by Sardtok » Sun Nov 01, 2009 4:40 pm

daveberk wrote:
subrime wrote:Anyway, what's Love needs more than speed improvement right now, IMHO, is utf8 support.
Do you mean supporting real-time rendering of any unicode glyph? Cause that's been discussed before, and it's not going to happen (at least not any time soon).
If you just need certain glyphs, you could use a bitmap font.
Take off every Zigg for great rapist.
Now, outgay that!

User avatar
subrime
Citizen
Posts: 76
Joined: Thu Nov 13, 2008 6:18 pm
Location: Australia

Re: LuaJIT 2.0

Post by subrime » Sun Nov 01, 2009 9:20 pm

daveberk:
There are a host of other hardware architectures that would be nuked by this (PPC32, PPC64, ARM, etc) - nothing kills portability like hand coded assembly...

But the main point stands: the biggest load in most games is already taken by external libraries that would get no benefit from LuaJIT.

SuperRad
Prole
Posts: 1
Joined: Thu Jun 18, 2009 12:36 am

Re: LuaJIT 2.0

Post by SuperRad » Tue Nov 03, 2009 3:18 pm

subrime wrote:daveberk:
There are a host of other hardware architectures that would be nuked by this (PPC32, PPC64, ARM, etc) - nothing kills portability like hand coded assembly...

But the main point stands: the biggest load in most games is already taken by external libraries that would get no benefit from LuaJIT.
Don't the majority of non-x86 platforms have quite poor OpenGL hardware support (ie lacking drivers), which will cause Love to crawl during rendering anyhow though?

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests