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

Optimize iteration #336

Merged
merged 7 commits into from
Sep 16, 2023
Merged

Optimize iteration #336

merged 7 commits into from
Sep 16, 2023

Conversation

Ralith
Copy link
Owner

@Ralith Ralith commented Sep 16, 2023

Stumbled across some major speedups while chipping away at #334. Iteration of large archetypes is now ~twice as fast, with no significant change elsewhere.

Before:

test iterate_100k                   ... bench:     130,153 ns/iter (+/- 12,301)
test iterate_cached_100_by_50       ... bench:       1,010 ns/iter (+/- 75)
test iterate_mut_100k               ... bench:     127,847 ns/iter (+/- 6,311)
test iterate_mut_cached_100_by_50   ... bench:         251 ns/iter (+/- 58)
test iterate_mut_uncached_100_by_50 ... bench:         602 ns/iter (+/- 138)
test iterate_uncached_100_by_50     ... bench:       2,146 ns/iter (+/- 44)

After:

test iterate_100k                   ... bench:      51,880 ns/iter (+/- 2,813)
test iterate_cached_100_by_50       ... bench:         957 ns/iter (+/- 117)
test iterate_mut_100k               ... bench:      65,218 ns/iter (+/- 5,915)
test iterate_mut_cached_100_by_50   ... bench:         220 ns/iter (+/- 7)
test iterate_mut_uncached_100_by_50 ... bench:         701 ns/iter (+/- 548)
test iterate_uncached_100_by_50     ... bench:       2,340 ns/iter (+/- 205)

@Ralith Ralith merged commit 7751086 into master Sep 16, 2023
4 checks passed
@Ralith Ralith deleted the optimize branch September 16, 2023 20:20
@Ralith
Copy link
Owner Author

Ralith commented Sep 16, 2023

Oddly this was much less impactful on my Ryzen 7800x3d desktop than my old i7-8550U laptop, though the outlining of next_archetype fixed iterate_mut being significantly slower than iterate there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant