Skip to content

Commit 738b147

Browse files
Sielunaickshonpe
andauthored
Add bevy_transform benchmarks (#23906)
# Objective - Add dedicated benchmarks for `bevy_transform`'s propagation systems to catch performance regressions. ## Solution **Benchmarks** (`benches/benches/bevy_transform/propagate.rs`): Added small benchmarks targeting each stage of the propagation pipeline individually. - `mark_dirty_trees` — localized vs. distributed leaf update patterns - `propagate_parent_transforms` — full recompute with roots changed vs. leaves changed (static optimization disabled to isolate traversal cost) - `transform_pipeline` — end-to-end pipeline with static optimization on/off, plus `ChildOf` reparent churn The hierarchy setup uses 48 roots × 6 depth layers with mixed fanout (4-4-3-3-2-2) and extra archetype padding (`MarkerA/B/C`) to reflect realistic gameplay scenes. ## Testing ```sh cargo bench -p benches --bench transform ``` --------- Co-authored-by: ickshonpe <27962798+ickshonpe@users.noreply.github.com>
1 parent 97c5d8d commit 738b147

3 files changed

Lines changed: 398 additions & 0 deletions

File tree

benches/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ bevy_asset = { path = "../crates/bevy_asset" }
2626
bevy_render = { path = "../crates/bevy_render" }
2727
bevy_scene = { path = "../crates/bevy_scene" }
2828
bevy_tasks = { path = "../crates/bevy_tasks" }
29+
bevy_transform = { path = "../crates/bevy_transform" }
2930
bevy_ui = { path = "../crates/bevy_ui" }
3031
bevy_platform = { path = "../crates/bevy_platform", default-features = false, features = [
3132
"std",
@@ -110,3 +111,8 @@ harness = false
110111
name = "tasks"
111112
path = "benches/bevy_tasks/main.rs"
112113
harness = false
114+
115+
[[bench]]
116+
name = "transform"
117+
path = "benches/bevy_transform/main.rs"
118+
harness = false
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use criterion::criterion_main;
2+
3+
mod propagate;
4+
5+
criterion_main!(propagate::benches);

0 commit comments

Comments
 (0)