refactor: make all criterion_group!s named benches

Now the distinguishing factor will be their module path, removing the need to rename the group itself if it switches modules.
This commit is contained in:
BD103 2024-12-09 14:39:16 -05:00
parent ee94d48f50
commit cbe1688dcd
11 changed files with 23 additions and 21 deletions

View file

@ -10,7 +10,7 @@ use rand::{prelude::SliceRandom, SeedableRng};
use rand_chacha::ChaCha8Rng; use rand_chacha::ChaCha8Rng;
criterion_group!( criterion_group!(
change_detection_benches, benches,
all_added_detection, all_added_detection,
all_changed_detection, all_changed_detection,
few_changed_detection, few_changed_detection,
@ -297,7 +297,9 @@ fn add_archetypes_entities<T: Component<Mutability = Mutable> + Default>(
} }
} }
} }
fn multiple_archetype_none_changed_detection_generic<T: Component<Mutability = Mutable> + Default + BenchModify>( fn multiple_archetype_none_changed_detection_generic<
T: Component<Mutability = Mutable> + Default + BenchModify,
>(
group: &mut BenchGroup, group: &mut BenchGroup,
archetype_count: u16, archetype_count: u16,
entity_count: u32, entity_count: u32,

View file

@ -13,7 +13,7 @@ mod insert_simple_unbatched;
use archetype_updates::*; use archetype_updates::*;
criterion_group!( criterion_group!(
components_benches, benches,
add_remove, add_remove,
add_remove_big, add_remove_big,
add_remove_very_big, add_remove_very_big,

View file

@ -1,7 +1,7 @@
use bevy_ecs::{component::Component, prelude::*, world::World}; use bevy_ecs::{component::Component, prelude::*, world::World};
use criterion::{black_box, criterion_group, BenchmarkId, Criterion}; use criterion::{black_box, criterion_group, BenchmarkId, Criterion};
criterion_group!(empty_archetypes_benches, empty_archetypes); criterion_group!(benches, empty_archetypes);
#[derive(Component)] #[derive(Component)]
struct A<const N: u16>(f32); struct A<const N: u16>(f32);

View file

@ -3,7 +3,7 @@ use criterion::*;
mod iter; mod iter;
mod send; mod send;
criterion_group!(event_benches, send, iter); criterion_group!(benches, send, iter);
fn send(c: &mut Criterion) { fn send(c: &mut Criterion) {
let mut group = c.benchmark_group("events_send"); let mut group = c.benchmark_group("events_send");

View file

@ -4,7 +4,7 @@ use core::hint::black_box;
use criterion::*; use criterion::*;
use glam::*; use glam::*;
criterion_group!(fragmentation_benches, iter_frag_empty); criterion_group!(benches, iter_frag_empty);
#[derive(Component, Default)] #[derive(Component, Default)]
struct Table<const X: usize = 0>(usize); struct Table<const X: usize = 0>(usize);

View file

@ -25,7 +25,7 @@ mod par_iter_simple_foreach_hybrid;
use heavy_compute::*; use heavy_compute::*;
criterion_group!( criterion_group!(
iterations_benches, benches,
iter_frag, iter_frag,
iter_frag_sparse, iter_frag_sparse,
iter_simple, iter_simple,

View file

@ -18,14 +18,14 @@ mod scheduling;
mod world; mod world;
criterion_main!( criterion_main!(
change_detection::change_detection_benches, change_detection::benches,
components::components_benches, components::benches,
empty_archetypes::empty_archetypes_benches, empty_archetypes::benches,
events::event_benches, events::benches,
iteration::iterations_benches, iteration::benches,
fragmentation::fragmentation_benches, fragmentation::benches,
observers::observer_benches, observers::benches,
scheduling::scheduling_benches, scheduling::benches,
world::world_benches, world::benches,
param::param_benches, param::benches,
); );

View file

@ -5,4 +5,4 @@ mod simple;
use propagation::*; use propagation::*;
use simple::*; use simple::*;
criterion_group!(observer_benches, event_propagation, observe_simple); criterion_group!(benches, event_propagation, observe_simple);

View file

@ -8,4 +8,4 @@ use combinator_system::*;
use dyn_param::*; use dyn_param::*;
use param_set::*; use param_set::*;
criterion_group!(param_benches, combinator_system, dyn_param, param_set); criterion_group!(benches, combinator_system, dyn_param, param_set);

View file

@ -9,7 +9,7 @@ use running_systems::*;
use schedule::*; use schedule::*;
criterion_group!( criterion_group!(
scheduling_benches, benches,
run_condition_yes, run_condition_yes,
run_condition_no, run_condition_no,
run_condition_yes_with_query, run_condition_yes_with_query,

View file

@ -19,7 +19,7 @@ mod entity_hash;
use entity_hash::*; use entity_hash::*;
criterion_group!( criterion_group!(
world_benches, benches,
empty_commands, empty_commands,
spawn_commands, spawn_commands,
insert_commands, insert_commands,