[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: LuaJIT vs. PyPy JIT (corrected)
- From: François Perrad <francois.perrad@<a href="/cgi-bin/echo.cgi?gadz.org">...</a>>
- Date: Thu, 11 Feb 2010 00:51:08 +0100
** Previous timing for target-toy-native & target-toy-jit are wrong. **
** So, the results are opposite **
After reading this post
and the referenced paper
I try to compare LuaJIT 2 and PyPy JIT, so I port the same toy
interpreter in Lua (toy.lua)
with the same application which computes the square of the accumulator.
And I write too a pure Python version without any PyPy stuff (toy.py)
and C version (toy.c).
I obtain the following results :
the compilation of target-toy-native needs 47s (size ~ 120kb).
the compilation of target-toy-jit needs 571s (size ~ 2Mb).
time python target-toy.py 1000000
time target-toy-native 1000000
time target-toy-jit 1000000
time python toy.py 1000000
time lua toy.lua 1000000
time luajit toy.lua 1000000
time ./toy 1000000
real 0.068s (when compiled with gcc -O2)
These tests are done on Ubuntu 9.10 (x86) with :
- gcc 4.4.1 (Ubuntu package)
- lua 5.1.4 (Ubuntu package)
- luajit 2 head
- python 2.6.4 (Ubuntu package)
- pypy trunk
Lua is faster (2x) than Python.
PyPy/C is comparable with gcc -O2, and faster (6x) than LuaJIT 2.
PyPy/JIT is faster (25x) than LuaJIT 2.
But LuaJIT doesn't need compilation stage.