-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Cluster small table/archetype into single Task in parallel iteration #12846
Conversation
Looks sensible, but I'd really like to see benchmarks on the impact of this change. |
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.
I'm a bit concerned what this will do with hierarchical parallel queries (i.e. transform propagation), where the top level parallel query has only a few values.
Otherwise looks good! Just one bit about allocation.
crates/bevy_ecs/src/query/state.rs
Outdated
let table = &tables[table_id]; | ||
if table.is_empty() { | ||
continue; | ||
let mut batch_queue = vec![]; |
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.
I'm not the biggest fan of needing to allocate a growable vec repeatedly. Could you try using arrayvec
, with a reasonable max queue size (128 seems more than reasonable).
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.
Objective
Solution