Skip to content

Commit

Permalink
feat: benchmark App::update()
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 committed Aug 12, 2024
1 parent 85f1cb1 commit 420b77b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
16 changes: 16 additions & 0 deletions benches/app/app.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use bevy::app::prelude::*;
use criterion::Criterion;

pub fn update(c: &mut Criterion) {
let mut group = c.benchmark_group("app::app::update");

group.bench_function("empty", |b| {
let mut app = App::empty();
b.iter(|| app.update());
});

group.bench_function("new", |b| {
let mut app = App::new();
b.iter(|| app.update());
});
}
5 changes: 5 additions & 0 deletions benches/app/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod app;

use criterion::criterion_group;

criterion_group!(group, app::update,);
3 changes: 2 additions & 1 deletion benches/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mod app;
mod ecs;

use criterion::criterion_main;
Expand All @@ -10,4 +11,4 @@ pub(crate) fn create_prng() -> impl Rng {
SmallRng::seed_from_u64(0x7df09deb486e920a)
}

criterion_main!(ecs::group);
criterion_main!(app::group, ecs::group);

0 comments on commit 420b77b

Please sign in to comment.