Page 1 of 1

How can I test LuaJIT?

PostPosted: Fri Apr 01, 2016 17:57
by burli
Hi, how can I find out if the LuaJIT is working? I compiled the code by myself and enabled the LuaJIT, but I want to make shure that he is really working

Re: How can I test LuaJIT?

PostPosted: Fri Apr 01, 2016 18:22
by kaeza
Use `cmake -LH | grep USE_LUAJIT` (or `cmake-gui` if you have it). It should be set to 1 or something else recognizable as "enabled".

From Lua, try if `require "jit"` succeeds.

Re: How can I test LuaJIT?

PostPosted: Fri Apr 01, 2016 18:33
by burli
Thx, with your hint I found this code

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if type(jit) == 'table' then
   print(jit.version)
end


Returns LuaJIT 2.0.2 so I think the Jit is availible. But can I benchmark this? Or do I have to compile minetest without without JIT and compare the performance?

Re: How can I test LuaJIT?

PostPosted: Fri Apr 01, 2016 18:36
by jp
Pause menu. Check for "USE_LUAJIT=1".

Re: How can I test LuaJIT?

PostPosted: Wed Apr 06, 2016 20:34
by kaeza
burli wrote:[...]But can I benchmark this? Or do I have to compile minetest without without JIT and compare the performance?

You need to do exactly that.

If the piece of code you want to benchmark does not depend on Minetest features, it's better to install stock Lua and LuaJIT as command-line tools and benchmark using them.