bevy/benches/benches
BD103 765166b727
Update entity cloning benchmarks (#17084)
# Objective

- `entity_cloning` was separated from the rest of the ECS benchmarks.
- There was some room for improvement in the benchmarks themselves.
- Part of #16647.

## Solution

- Merge `entity_cloning` into the rest of the ECS benchmarks.
- Apply the `bench!` macro to all benchmark names.\
- Reorganize benchmarks and their helper functions, with more comments
than before.
- Remove all the extra component definitions (`C2`, `C3`, etc.), and
just leave one. Now all entities have exactly one component.

## Testing

```sh
# List all entity cloning benchmarks, to verify their names have updated.
cargo bench -p benches --bench ecs entity_cloning -- --list

# Test benchmarks by running them once.
cargo test -p benches --bench ecs entity_cloning

# Run all benchmarks (takes about a minute).
cargo bench -p benches --bench ecs entity_cloning
```

---

## Showcase


![image](https://github.com/user-attachments/assets/4e3d7d98-015a-4974-ae16-363cf1b9423c)

Interestingly, using `Clone` instead of `Reflect` appears to be 2-2.5
times faster. Furthermore, there were noticeable jumps in time when
running the benchmarks:


![image](https://github.com/user-attachments/assets/bd8513de-3922-432f-b3dd-1b1b7750bdb5)


I theorize this is because the `World` is allocating more space for all
the entities, but I don't know for certain. Neat!
2025-01-02 19:55:35 +00:00
..
bevy_ecs Update entity cloning benchmarks (#17084) 2025-01-02 19:55:35 +00:00
bevy_math Overhaul bezier curve benchmarks (#17016) 2024-12-29 20:55:08 +00:00
bevy_picking Overhaul picking benchmarks (#17033) 2024-12-30 21:04:24 +00:00
bevy_reflect Migrate to core::hint::black_box() (#16980) 2024-12-29 19:33:42 +00:00
bevy_render Migrate to core::hint::black_box() (#16980) 2024-12-29 19:33:42 +00:00
bevy_tasks Migrate to core::hint::black_box() (#16980) 2024-12-29 19:33:42 +00:00