bevy/crates/bevy_scene/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
..
command.rs [ecs] Improve Commands performance (#2332) 2021-07-16 19:57:20 +00:00
dynamic_scene.rs Fix error in DynamicScene (#1651) 2021-03-14 20:02:10 +00:00
lib.rs Hide re-exported docs (#1985) 2021-04-27 18:29:33 +00:00
scene_loader.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
scene_spawner.rs flip resource scope order (#1793) 2021-04-01 02:24:42 +00:00
scene.rs Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
serde.rs Bevy Reflection (#926) 2020-11-27 16:39:59 -08:00