mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
ecb78048cf
# Objective - Currently `Commands` are quite slow due to the need to allocate for each command and wrap it in a `Box<dyn Command>`. - For example: ```rust fn my_system(mut cmds: Commands) { cmds.spawn().insert(42).insert(3.14); } ``` will have 3 separate `Box<dyn Command>` that need to be allocated and ran. ## Solution - Utilize a specialized data structure keyed `CommandQueueInner`. - The purpose of `CommandQueueInner` is to hold a collection of commands in contiguous memory. - This allows us to store each `Command` type contiguously in memory and quickly iterate through them and apply the `Command::write` trait function to each element. |
||
---|---|---|
.. | ||
benches | ||
Cargo.toml |