How can I test LuaJIT?

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

How can I test LuaJIT?

by burli » Fri Apr 01, 2016 17:57

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
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: How can I test LuaJIT?

by kaeza » Fri Apr 01, 2016 18:22

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.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: How can I test LuaJIT?

by burli » Fri Apr 01, 2016 18:33

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?
 

User avatar
jp
Member
 
Posts: 705
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith

Re: How can I test LuaJIT?

by jp » Fri Apr 01, 2016 18:36

Pause menu. Check for "USE_LUAJIT=1".
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: How can I test LuaJIT?

by kaeza » Wed Apr 06, 2016 20:34

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.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 5 guests

cron