-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Get names of queued components #18451
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
alice-i-cecile
merged 16 commits into
bevyengine:main
from
ElliottjPierce:get-names-of-queued-components
Mar 31, 2025
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c9509fe
include descriptor on queued components
ElliottjPierce d7bc388
remove indirection in register_resource_unchecked_with
ElliottjPierce 788ed67
change backing descriptors to arcs
ElliottjPierce b6aa68e
allow getting the descriptor and name of queued ids
ElliottjPierce f9f3264
cleanup
ElliottjPierce ddc4a6f
superficial changes while I'm here
ElliottjPierce 5f8e208
fixed doc
ElliottjPierce 90ad95f
use a Cow to prevent clones
ElliottjPierce 2f01fa2
doc and usability improvements
ElliottjPierce b7b785f
clean up some related issues
ElliottjPierce 5fedc19
use atomicow and only arc if needed
ElliottjPierce dcb9dd3
Chain iterators
ElliottjPierce 4d90ac5
remove atomic cow and simplify
ElliottjPierce 3e632b6
fix doc
ElliottjPierce 470dc37
Update crates/bevy_ecs/src/component.rs
ElliottjPierce 47b203c
remove unused import
ElliottjPierce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linear search here looks expensive. Instead of putting the descriptors in the individual queues, would it make sense to have a separate
HashMap<ComponentId, Arc<ComponentDescriptor>>
? For that matter, theComponentId
s are dense, so I think it could beVec<Arc<ComponentDescriptor>>
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the linear search is not ideal, but this is a cold path. Ids are almost always correct unless this is in a inter-world context, and queued components aren't queued for long. I genuinely think it would be slower to cache it's location somewhere or change the backing data structure because that slows everything down by a tiny bit, where as this slows almost nothing down (but by a lot).
That's why I did it this way (even though it hurts my eyes too). But if the consensus is different, I can absolutely do otherwise.