NovelRT
NovelRT copied to clipboard
ECS optimisation - parrelelise the updating of the root sets.
As the title suggests, currently we only handle the updating of the root set of each component buffer sequentially (on the "main" thread, if you prefer). Given the nature of how C++ collections work I think we could make this work be done concurrently instead, much like how systems are currently executed concurrently, as the final updates are self-contained to each buffer. This would vastly help in cases where there are many component types, cutting down on the time each frame takes.
At the moment, this is relying on an event, which means each buffer gets updated sequentially. This should be reworked to allow it to be concurrent.
Just to make it clear: We would get rid of the event? -> not editing the event class itself to make it parallel.
Then would an utility class "ParallelEvent" based on the Event be interesting?
Taking this one.
In short: Create a generic job system/threadpool, and then use that to parallelize set updates.
In long: I'll get some code examples of what I mean soon™