Skip to content

Automatically specify batch size for parallel iteration #3184

Closed

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.

Activity

  1. added
    A-ECSEntities, components, systems, and events
    C-PerformanceA change motivated by improving speed, memory usage or compile times
    C-UsabilityA targeted quality-of-life change that makes Bevy easier to use
    on Nov 25, 2021
  2. added
    S-Needs-DesignThis issue requires design work to think about how it would best be accomplished
    on Dec 12, 2021
  3. alice-i-cecile commented on Dec 12, 2021

    @alice-i-cecile
    MemberAuthor

    Some design work (or benchmarking) is needed to determine what good defaults might be, but otherwise this is a simple PR.

  4. added
    S-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!
    and removed
    S-Needs-DesignThis issue requires design work to think about how it would best be accomplished
    on Dec 12, 2021
  5. added a commit that references this issue on Jan 20, 2023
    dfea88c
  6. added a commit that references this issue on Jan 22, 2023
    b423f9a
  7. added a commit that references this issue on Feb 1, 2023
    9fa40d0
  8. added a commit that references this issue on Mar 4, 2023
    76b8829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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