lua-users home
lua-l archive

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


Hi,

I implemented following additional op codes:
LOADNIL
LOADFZ (Ravi extension - sets a register to floating point 0)
ADDFN (Ravi extension - adds a floating point value in register B to
operand C  and stores in register A)

With this I am able to run the following Ravi code:

local function x()
  local j:double
  for i=1,1000000000 do
  j = j+1
  end
  return j
end

Equivalent Lua code is:

local function x()
  local j=0.0
  for i=1,1000000000 do
  j = j+1.0
  end
  return j
end


I ran another comparison with Luajit, Lua 5.3 and Ravi:

C:\github\ravi\ravi-tests>\luajit\luajit.exe fornum_test2.lua
1000000000
time taken      0.93

C:\github\ravi\ravi-tests>\lua-5.3.0\src\build\Release\lua.exe fornum_test2.lua
1000000000.0
time taken      9.746

C:\github\ravi\ravi-tests>..\build\Debug\lua.exe fornum_test2.ravi
1000000000.0
time taken      2.782

C:\github\ravi\ravi-tests>\luajit\luajit.exe fornum_test2.lua
1000000000
time taken      0.946

C:\github\ravi\ravi-tests>\lua-5.3.0\src\build\Release\lua.exe fornum_test2.lua
1000000000.0
time taken      9.667

C:\github\ravi\ravi-tests>..\build\Debug\lua.exe fornum_test2.ravi
1000000000.0
time taken      2.786

C:\github\ravi\ravi-tests>\luajit\luajit.exe fornum_test2.lua
1000000000
time taken      0.947

C:\github\ravi\ravi-tests>\lua-5.3.0\src\build\Release\lua.exe fornum_test2.lua
1000000000.0
time taken      9.57

C:\github\ravi\ravi-tests>..\build\Debug\lua.exe fornum_test2.ravi
1000000000.0
time taken      2.829