Since Lua only has tables, which are associative arrays, the components might never be right next to each other in memory / cache.
Is it possible to implement fast ECS ? If not then what are some alternatives in terms of development ease and modularity.
Is cache friendly ECS possible in Lua ?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Is cache friendly ECS possible in Lua ?
Here's one: https://github.com/tjakka5/Concord
Didn't look too deep into it, maybe it doesn't use FFI, but it's probably still fast enough.
If one wrote an ECS with LuaJIT's FFI, supporting C types including structs and arrays, LuaJIT *might* be a bit better in terms of memory layout and caching than pure lua solutions... but to be honest, i haven't tested that yet.
Didn't look too deep into it, maybe it doesn't use FFI, but it's probably still fast enough.
If one wrote an ECS with LuaJIT's FFI, supporting C types including structs and arrays, LuaJIT *might* be a bit better in terms of memory layout and caching than pure lua solutions... but to be honest, i haven't tested that yet.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Is cache friendly ECS possible in Lua ?
Thanks, I'll look into itzorg wrote: ↑Tue Jun 02, 2020 12:57 pm Here's one: https://github.com/tjakka5/Concord
Didn't look too deep into it, maybe it doesn't use FFI, but it's probably still fast enough.
If one wrote an ECS with LuaJIT's FFI, supporting C types including structs and arrays, LuaJIT *might* be a bit better in terms of memory layout and caching than pure lua solutions... but to be honest, i haven't tested that yet.
Who is online
Users browsing this forum: Bing [Bot] and 5 guests