[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lua versus Ravi versus Luajit - a simple benchmark
- From: Dibyendu Majumdar <mobile@...>
- Date: Sun, 1 Mar 2015 22:22:02 +0000
Hi,
I just implemented LLVM based JIT compilation of OP_FORPREP,
OP_FORLOOP and OP_MOVE in Ravi. So this allows me to run a simple
benchmark given below. Note that the benchmark is run twice and time
measured for the second run - this is to eliminate any cost of
compilation.
Results:
Lua 5.3: 9.36 seconds
Ravi using LLVM: 2.823 seconds
Luajit 2.1.0: 0.309 seconds
I do not know yet what changes I could make to improve Ravi's
performance in this test - I will wait until I have implemented most
of the other byte codes I need before delving deeper into improving
things.
-----------------------------------------------------------------------
local function x()
local j = 0.0
for i=2.0,1000000000.0 do
j = i
end
return j
end
x()
local t1 = os.clock()
local y = x();
local t2 = os.clock()
print(y)
assert(y == 1000000000.0)
print("time taken ", t2-t1);