bevy_ecs performance regression in 0.16.0 release (get + insertion)
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
# Problem
As [spotted](https://discord.com/channels/691052431525675048/749335865876021248/1380318173798072371) by @SanderMertens of [flecs](https://github.com/SanderMertens/flecs), Bevy's ECS perf had a serious regression from Bevy 0.15 to Bevy 0.16.
For many users, this may have been outweighed by the improvements to rendering performance and transform propagation; hence why this is just now being found and reported.

See [this gist](https://gist.github.com/SanderMertens/b98ea829a1477f9b8620dd5878f707a3) for the exact benches used.
## Path to a solution
We should focus on the get / get_mut regressions first: those are larger so they'll be easier to spot. We may have multiple independent regressions, particularly since insertion / removal are also affected. The relations regressions are less surprising (we completely changed our strategy there), but should be rechecked once the other regressions are fixed.
1. Bench for Bevy 0.15.
2. Bench for Bevy 0.16
3. Bench for Bevy main (we may have somehow fixed this)
4. Bisect from Bevy 0.15 to Bevy 0.16 by git commits to figure out where this was introduced.
5. Report back so we can coordinate a fix.
6. Fix!
7. Ideally, release a point release removing or at least ameliorating the regression.
Contributor guide
Assessment
This issue has not been assessed yet.