3 ms·
Yes, organizing components as SoA can provide a significant performance boost in Lua, especially with LuaJIT. Both iteration and element access become faster, a
by blackmat 1y ago
Yes, organizing components as SoA can provide a significant performance boost in Lua, especially with LuaJIT. Both iteration and element access become faster, and it also reduces memory allocations and GC pressure when creating entities. And yes, Lua tables can be contiguous in memory if you use them carefully.
- dicytea 1y agoDo you have any published benchmarks?
- blackmat 1y agoComparative benchmarks are a big task on their own, and usually the author's library wins in them. I have internal benchmarks in the repository, but they are not designed for comparison or for evaluation by outsiders. Maybe I'll get to that someday. As for the SoA approach, here you can find a small and exaggerated example: https://luajit.org/ext_ffi.html https://luajit.org/ext_ffi.html