NovelRT icon indicating copy to clipboard operation
NovelRT copied to clipboard

ECS optimisation - parrelelise the updating of the root sets.

Open RubyNova opened this issue 2 years ago • 2 comments

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.

RubyNova avatar Sep 18 '21 18:09 RubyNova

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?

Shidesu avatar Mar 08 '22 02:03 Shidesu

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™

thaumanovic avatar Mar 06 '23 03:03 thaumanovic