Is cache friendly ECS possible in Lua ?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
inJuly
Prole
Posts: 29
Joined: Fri May 01, 2020 9:02 pm
Contact:

Is cache friendly ECS possible in Lua ?

Post by inJuly »

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.
User avatar
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 ?

Post by zorg »

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.
Me and my stuff :3True 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.
User avatar
inJuly
Prole
Posts: 29
Joined: Fri May 01, 2020 9:02 pm
Contact:

Re: Is cache friendly ECS possible in Lua ?

Post by inJuly »

zorg 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.
Thanks, I'll look into it
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests