![]() # Objective While profiling around to validate the results of #9172, I noticed that `present_frames` can take a significant amount of time. Digging into the cause, it seems like we're creating a new `QueryState` from scratch every frame. This involves scanning the entire World's metadata instead of just updating its view of the world. ## Solution Use a `SystemState` argument to cache the `QueryState` to avoid this construction cost. ## Performance Against `many_foxes`, this seems to cut the time spent in `present_frames` by nearly almost 2x. Yellow is this PR, red is main.  |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml |