lua-users home
lua-l archive

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


Hi,

This is another test. It is a modified version of the first fornum
test just to make things a bit more difficult.

local function x()
  local j = 0.0
  for i=2.0,1000000000.0 do
  j = i
  for k=3,5 do
  j = k
  end
  end
  return j
end

You can see the test programs, and generated LLVM IR at:
https://github.com/dibyendumajumdar/ravi/tree/master/ravi-tests


C:\github\ravi\ravi-tests>\luajit\luajit.exe fornum_test3.lua
5
time taken      7.806

C:\github\ravi\ravi-tests>\luajit\luajit.exe fornum_test3.lua
5
time taken      7.927

C:\github\ravi\ravi-tests>\luajit\luajit.exe fornum_test3.lua
5
time taken      7.92

C:\github\ravi\ravi-tests>\lua-5.3.0\src\build\Release\lua.exe fornum_test3.lua
5
time taken      53.932

C:\github\ravi\ravi-tests>\lua-5.3.0\src\build\Release\lua.exe fornum_test3.lua
5
time taken      54.64

C:\github\ravi\ravi-tests>\lua-5.3.0\src\build\Release\lua.exe fornum_test3.lua
5
time taken      54.584

C:\github\ravi\ravi-tests>..\build\Debug\lua.exe fornum_test3.lua
2>fornum_test3.ll
5
time taken      17.196

C:\github\ravi\ravi-tests>..\build\Debug\lua.exe fornum_test3.lua
2>fornum_test3.ll
5
time taken      15.92

C:\github\ravi\ravi-tests>..\build\Debug\lua.exe fornum_test3.lua
2>fornum_test3.ll
5
time taken      16.371