rust-gamedev / ecs_bench_suite

A suite of benchmarks designed to test and compare Rust ECS library performance across a variety of challenging circumstances.
78 stars 33 forks source link

Use faster .for_each iteration in Bevy code #24

Open alice-i-cecile opened 3 years ago

alice-i-cecile commented 3 years ago

Iterating with the for_each is substantially faster in Bevy as of 0.5.

While many systems will not be written in this way (for loops are great!), performance critical ones will be, which means that it is likely to be more reflective of actual use.

cart commented 3 years ago

Yup other ECS-es currently use "fast path" apis, such as SoA insertion and for_each iterators (despite other apis being "more idiomatic" or "recommended"). I think it is fair play at this point to do the same for Bevy.

However this is my current take on ecs_bench_suite policy/labeling in general: https://github.com/rust-gamedev/ecs_bench_suite/pull/18#issuecomment-811553276

The current approach biases toward the wrong behaviors and makes it harder for developers to make an informed decision when picking an ECS.