Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - for disconnected, use Vec instead of HashSet to reduce insert overhead #7744

Closed
wants to merge 2 commits into from

Conversation

shuoli84
Copy link
Contributor

Objective

  • Improve Schedule::initialize performance

Solution

  • replace disconnected's type from HashSet to Vec in check_graph

@shuoli84
Copy link
Contributor Author

Bench result

➜ critcmp schedule_base schedule_optimize
group                                         schedule_base                          schedule_optimize
-----                                         -------------                          -----------------
build_schedule/1000_schedule                  1.07       2.3±0.15s        ? ?/sec    1.00       2.1±0.11s        ? ?/sec
build_schedule/1000_schedule_noconstraints    2.99     65.3±0.79ms        ? ?/sec    1.00     21.8±0.37ms        ? ?/sec
build_schedule/100_schedule                   1.06     12.8±0.08ms        ? ?/sec    1.00     12.2±0.07ms        ? ?/sec
build_schedule/100_schedule_noconstraints     1.47  1300.6±15.21µs        ? ?/sec    1.00  887.8±192.92µs        ? ?/sec
build_schedule/500_schedule                   1.04    388.1±5.32ms        ? ?/sec    1.00    372.4±6.56ms        ? ?/sec
build_schedule/500_schedule_noconstraints     2.50     16.1±0.14ms        ? ?/sec    1.00      6.5±0.17ms        ? ?/sec
schedule/base                                 1.00     25.7±0.22µs        ? ?/sec    1.01     26.0±0.46µs        ? ?/sec

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times labels Feb 19, 2023
Copy link
Member

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

Choose a reason for hiding this comment

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

Nice benchmarking, thanks!

@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 Feb 19, 2023
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Feb 19, 2023
#7744)

# Objective

- Improve `Schedule::initialize` performance

## Solution

- replace `disconnected`'s type from HashSet to Vec in `check_graph`
@bors bors bot changed the title for disconnected, use Vec instead of HashSet to reduce insert overhead [Merged by Bors] - for disconnected, use Vec instead of HashSet to reduce insert overhead Feb 19, 2023
@bors bors bot closed this Feb 19, 2023
myreprise1 pushed a commit to myreprise1/bevy that referenced this pull request Mar 23, 2023
bevyengine#7744)

# Objective

- Improve `Schedule::initialize` performance

## Solution

- replace `disconnected`'s type from HashSet to Vec in `check_graph`
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-Performance A change motivated by improving speed, memory usage or compile times 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.

None yet

3 participants