3 ms·
I'd love to see a benchmark on which LuaJIT is significantly slower than Lua, if you have a link.
by omaranto 9y ago
I'd love to see a benchmark on which LuaJIT is significantly slower than Lua, if you have a link.
- chubot 9y agoI probably overstated... I don't think JITs including LuaJIT do much for string manipulation, but that would mean it's on par with Lua. Off the top of my head I think of Lua/Python as 10-100x slower than C, but LuaJIT might get you within 2x for some numerical workloads. But it will not get you within 2x for string workloads -- it's still in the 10x or worse category. Someone reported a slower benchmark here but the maintainer argued that is invalid. But he says all the time is within C functions, which is what I was getting at. https://www.freelists.org/post/luajit/Luajit-string-concatenation-performance,10 https://www.freelists.org/post/luajit/Luajit-string-concaten... A couple people mention string performance here, without many details: https://news.ycombinator.com/item?id=12573981 https://news.ycombinator.com/item?id=12573981 I think the bottom line is that the semantics of Lua strings are completely different than how you manage strings in C, so there's a limit to how much you can optimize the program, even if you have a lot of time to (which the JIT does not.)
- etiene 9y agoUsing the C api instead of the FFI is slower in LuaJIT than Lua and vice-versa. So there are still optimal solutions for each one.