Bevy version 0.13
- Original: 0.12.1 release from Cargo.
- Current: 0.13.0 release from Cargo.
Relevant system information
Please include:
- The Rust version you're using: 1.76
- the operating system or browser used, including its version
What's performing poorly?
The schedule is running slower than before, which slowed down my program by 20%. This can impact the performance of real-time simulation applications and may significantly lower the performance when you scale the systems with more schedule plans.
It can be reproduced by running empty schedules:
use std::time::Instant;
use bevy_ecs::schedule;
use bevy_app::prelude::*;
fn main() {
let mut app = bevy_app::App::default();
app.add_schedule(schedule::Schedule::new(First));
app.add_schedule(schedule::Schedule::new(PreUpdate));
app.add_schedule(schedule::Schedule::new(Update));
app.add_schedule(schedule::Schedule::new(PostUpdate));
app.add_schedule(schedule::Schedule::new(Last));
let now = Instant::now();
for _i in 0..20_000_000 {
app.update();
}
println!("{}", now.elapsed().as_micros() as f64 / 1e6);
}
Performance table for this code:
With LTO = yes
| Test Case |
Time |
Slow Down |
| bevy_ecs 0.12.1 |
13.694943 |
0% |
| bevy_ecs 0.13, default-features = false |
14.759885 |
7.778% |
| bevy_ecs 0.13 |
15.566676 |
13.7% |
With LTO turned-off
| Test Case |
Time |
Slow Down |
| bevy_ecs 0.12.1 |
15.359637 |
0% |
| bevy_ecs 0.13, default-features = false |
16.61063 |
8% |
| bevy_ecs 0.13 |
17.642636 |
14.9% |
The slowing down is obvious, and I don't use the profiler because such overhead is not caused by user systems.
Bevy version 0.13
Relevant system information
Please include:
What's performing poorly?
The schedule is running slower than before, which slowed down my program by 20%. This can impact the performance of real-time simulation applications and may significantly lower the performance when you scale the systems with more schedule plans.
It can be reproduced by running empty schedules:
Performance table for this code:
With LTO = yes
With LTO turned-off
The slowing down is obvious, and I don't use the profiler because such overhead is not caused by user systems.