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

Make a note about the performance of Query::is_empty #12466

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

james7132
Copy link
Member

Objective

Query::is_empty does not mention the potential performance footgun of using it with non-archetypal filters.

Solution

Document it.

@james7132 james7132 added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events labels Mar 14, 2024
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.

I'd like the same note added to QueryIter::len here please.

@james7132
Copy link
Member Author

james7132 commented Mar 14, 2024

I'd like the same note added to QueryIter::len here please.

Not sure what to put there since it scales with the number of matched archetypes/tables instead of number of entities, and the cost for non-archetypal queries for Query::is_empty is not present for QueryIter::len.

@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 Mar 14, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 14, 2024
Merged via the queue into bevyengine:main with commit 4b64d1d Mar 14, 2024
25 checks passed
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-Docs An addition or correction to our documentation 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.

4 participants