Skip to content

Use single threaded executor for archetype benches#9835

Merged
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
nicopap:benchmark-noarch-fix
Sep 18, 2023
Merged

Use single threaded executor for archetype benches#9835
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
nicopap:benchmark-noarch-fix

Conversation

@nicopap

@nicopap nicopap commented Sep 18, 2023

Copy link
Copy Markdown
Contributor

Objective

no_archetype benchmark group results were very noisy

Solution

Use the SingeThreaded executor.

On my machine, this makes the no_archetype bench group 20 to 30 times faster. Meaning that most of the runtime was accounted by the multithreaded scheduler. ie: the benchmark was not testing system archetype update, but the overhead of multithreaded scheduling.

With this change, the benchmark results are more meaningful.

The add_archetypes function is also simplified.

On my machine, this makes the `no_archetype` bench group 20 to 30 times
faster. Meaning that most of the runtime was accounted by the
multithreaded scheduler. ie: the benchmark was not testing system
archetype update, but the overhead of multithreaded scheduling.

With this change, the benchmark results are more meaningful.

The add_archetypes function is also simplified.
@nicopap nicopap added A-ECS Entities, components, systems, and events C-Testing A change that impacts how we test Bevy or how users test their apps labels Sep 18, 2023

@alice-i-cecile alice-i-cecile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Should we make this change for more of our benchmarks?

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Sep 18, 2023
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Sep 18, 2023
Merged via the queue into bevyengine:main with commit 359e6c7 Sep 18, 2023
@nicopap
nicopap deleted the benchmark-noarch-fix branch September 20, 2023 13:07
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

`no_archetype` benchmark group results were very noisy

## Solution

Use the `SingeThreaded` executor.

On my machine, this makes the `no_archetype` bench group 20 to 30 times
faster. Meaning that most of the runtime was accounted by the
multithreaded scheduler. ie: the benchmark was not testing system
archetype update, but the overhead of multithreaded scheduling.

With this change, the benchmark results are more meaningful.

The add_archetypes function is also simplified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Testing A change that impacts how we test Bevy or how users test their apps S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants