Skip to content

Commit

Permalink
add a perf note
Browse files Browse the repository at this point in the history
  • Loading branch information
hymm committed Mar 10, 2024
1 parent 6bfea24 commit 2c0c481
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/bevy_ecs/src/query/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,12 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
/// safe methods on `QueryState` call [`QueryState::update_archetypes`] internally, so
/// this is best used through a `Query`.
///
/// ## Performance
///
/// This will have similar performance as constructing a new `QueryState` since much of internal state
/// needs to be reconstructed. But it will be a little faster as it only needs to compare the intersection
/// of matching archetypes rather than iterating over all archetypes.
///
/// ## Panics
///
/// Will panic if `NewD` contains accesses not in `Q` or `OtherQ`.
Expand Down

0 comments on commit 2c0c481

Please sign in to comment.