Skip to content

bevy_ecs performance regression in 0.16.0 release (get + insertion) #19504

@alice-i-cecile

Description

@alice-i-cecile

Problem

As spotted by @SanderMertens of 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.

Image

See this gist 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-PerformanceA change motivated by improving speed, memory usage or compile timesP-HighThis is particularly urgent, and deserves immediate attentionP-RegressionFunctionality that used to work but no longer does. Add a test for this!S-Needs-BenchmarkingThis set of changes needs performance benchmarking to double-check that they help

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions