Open dgavedissian opened 1 year ago
Lua problems:
Currently a system is generated like this https://github.com/Limit-Theory-Redux/ltheory/blob/main/script/GameObjects/Entities/Test/System.lua
While there are lots of things that can still be optimized in lua (already on it) we will eventually reach a ceiling which needs to be addressed sooner or later.
Currently, the Lua VM is completely single threaded with some cooperative multitasking support using coroutines. This will still saturate the main thread and limit performance.
Some multithreading frameworks exist (with significant code support on the native side), such as:
I think the rough idea is that we want to have one Lua VM for each thread, and utilise some kind of message passing protocol to communicate between the "threads". That means passing only basic Lua objects like strings/ints/etc that can be serialized/deserialized to bytes, essentially equivalent to a networking protocol but within a single process.