Skip to content

Automatically specify batch size for parallel iteration #3184

Closed
@alice-i-cecile

Description

@alice-i-cecile

What problem does this solve or what need does it fill?

The parallel iteration tools that currently exist in Bevy require users to manually set a

As seen in https://github.com/bevyengine/bevy/blob/main/examples/ecs/parallel_query.rs.

What solution would you like?

As in #3183:

  1. Rename the existing methods to par_for_each_manual and so on.
  2. Remove the ability to set the batch size for the user.
  3. Set the batch size automatically using some simple and low-overhead heuristic.

What alternative(s) have you considered?

More sophisticated strategies could be specified, but that is beyond the scope of this issue, which is focused on ergonomics.

Additional context

Works hand-in-hand with #3183, to finish improving the default ergonomics of parallel iteration.

Smarter control over the thread count should help improve the serious performance issues noted in #2173.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-PerformanceA change motivated by improving speed, memory usage or compile timesC-UsabilityA targeted quality-of-life change that makes Bevy easier to useS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions