bevy/crates/bevy_transform/src
Nathan Ward ecb78048cf [ecs] Improve Commands performance (#2332)
# 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.
2021-07-16 19:57:20 +00:00
..
components Update glam (0.15.1) and hexasphere (3.4) (#2199) 2021-05-18 18:56:15 +00:00
hierarchy [ecs] Improve Commands performance (#2332) 2021-07-16 19:57:20 +00:00
lib.rs Hide re-exported docs (#1985) 2021-04-27 18:29:33 +00:00
transform_propagate_system.rs Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00