Page 1 of 1
Why Doesn't Minetest Use Luajit?

Posted:
Mon Jan 18, 2016 05:37
by TheReaperKing
I'm not much of a coder but I have heard a lot of people singing the praises of Luajit over Lua. I saw that sfan's builds use Luajit as well. I am interested to know why default minetest doesn't use Luajit and what the advantages and disadvantages are. I'm personally not saying one is better than the other, I am simply asking to learn more about both. Thanks and take care!
-Mike
Re: Why Doesn't Minetest Use Luajit?

Posted:
Mon Jan 18, 2016 10:58
by everamzah
I think the default is to use luajit. I have both installed on my system, and when I compile minetest it picks luajit.
Re: Why Doesn't Minetest Use Luajit?

Posted:
Mon Jan 18, 2016 11:19
by jp
TheReaperKing wrote:what the advantages and disadvantages are.
It compiles the Lua code on the fly and make it ~5x faster compared to plain Lua, getting close to C++ in execution overall.
The downside is a poor memory management. LuaJIT winces when it deals with greedy mods consuming >2 GB RAM.
Re: Why Doesn't Minetest Use Luajit?

Posted:
Mon Jan 18, 2016 11:43
by rubenwardy
Minetest does use luajit if your build has it enabled.
You only really see an advantage of luajit if you're running a server or lua intensive mods. It causes problems sometimes, AFAIK, which is why it isn't in the official build.
Re: Why Doesn't Minetest Use Luajit?

Posted:
Mon Jan 18, 2016 23:30
by TheReaperKing
Super insightful, thank you! I am hosting a server at a school for my kiddos so I think it will be worth testing luajit vs lua. I could simply just run sfan's one day with all the mods and regular minetest with all the mods another day. I'm very interested in the idea of compiling luajit with the educational version I'm working on so thanks for the info that it is that easy to add it as selecting it during compile. Take care and I hope you all have an awesome day!
-Mike
Re: Why Doesn't Minetest Use Luajit?

Posted:
Tue Jan 19, 2016 12:49
by twoelk
Lua "not enough memory" error #2988 This discussion might give more insight
Re: Why Doesn't Minetest Use Luajit?

Posted:
Wed Jan 20, 2016 04:03
by TheReaperKing
I learned so much from that twoelk, thank you so much for the link!
Re: Why Doesn't Minetest Use Luajit?

Posted:
Sat Jan 23, 2016 21:50
by est31
LuaJIT and Lua both have bad memory management. The 2GB cap introduced by luajit is just so that it can stay performant, while lua itself gets slower and slower.
Re: Why Doesn't Minetest Use Luajit?

Posted:
Sun Jan 31, 2016 08:30
by DI3HARD139
I wish there was a build that uses the standard lua. Needing a client that can handle high lua memory usage.