-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Overlap system set executions #19650
Copy link
Copy link
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!S-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!S-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Type
Fields
Give feedbackNo fields configured for issues without a type.
What problem does this solve or what need does it fill?
Imagine an app with two systems, A and B, who don't have any conflicting resource accesses. System A is scheduled in system set X, and system B is scheduled in system set Y. The system sets are ordered (X, Y).chain().
Execution for A and B is currently done serially, even though there's nothing in theory disallowing overlap between them.
The render world heavily uses system sets to order execution, as otherwise it would be very difficult to always manually specify that bind_foo systems need to run after prepare_a, prepare_b, prepare_c, etc.
However this leads to unfortunate gaps where we have idle threads waiting for a few final systems to finish before starting the next system set:
The caveat is dependencies that Bevy can't track, such as interior mutability on read-only component/resource accesses, or global variables.
What solution would you like?
Allow execution of systems in different system sets to overlap.
What alternative(s) have you considered?
Rework the render world to not use system sets.