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

Add a for each method for visiting query results due to its superior performance compared to the iterator variant. #18

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

adamreichold
Copy link
Owner

I am somewhat surprised at how much better the code gen is:

test query_single_archetype                    ... bench:      47,422 ns/iter (+/- 469)
test query_for_each_single_archetype           ... bench:      16,677 ns/iter (+/- 355)

test query_many_archetypes                     ... bench:      47,881 ns/iter (+/- 639)
test query_for_each_many_archetypes            ... bench:      13,714 ns/iter (+/- 4,037)

test query_very_many_small_archetypes          ... bench:       1,213 ns/iter (+/- 38)
test query_for_each_very_many_small_archetypes ... bench:         863 ns/iter (+/- 7)

…performance compared to the iterator variant.
@adamreichold adamreichold self-assigned this Oct 29, 2021
@adamreichold adamreichold merged commit e62af17 into main Nov 3, 2021
@adamreichold adamreichold deleted the for-each branch November 3, 2021 15:30
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.

2 participants