Maximize distance between exclusive systems
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
After #11845, `handle_internal_asset_events`, an exclusive system, was moved to `PreUpdate`, however, due to it's ordering constraint, all of the `TrackAssets` events cannot start until it's done. However, the exclusive system conflicts with every other system that is topologically sorted before it, so it can't start until all of them are finished. Even though there is no strict ordering constraint between the exclusive system and the systems running before it, it will prevent these two groups of systems from running in parallel with each other, which may have a performance cost.

## What solution would you like?
Change the topological sort on a schedule's system to maximize the number of systems that can parallelize together by forcing exclusive systems apart as much as possible.
This was already done for `apply_deferred`, perhaps the same logic can be applied to other exclusive systems as well?
## What alternative(s) have you considered?
Leaving it as is.
Contributor guide
Assessment
This issue has not been assessed yet.