
# Objective - Benchmarks are inconsistently setup, there are several that do not compile, and several others that need to be reformatted. - Related / precursor to #16647, this is part of my attempt migrating [`bevy-bencher`](https://github.com/TheBevyFlock/bevy-bencher) to the official benchmarks. ## Solution > [!TIP] > > I recommend reviewing this PR commit-by-commit, instead of all at once! In5d26f56eb9
I reorganized how benches were registered. Now this is one `[[bench]]` per Bevy crate. In each crate benchmark folder, there is a `main.rs` that calls `criterion_main!`. I also disabled automatic benchmark discovery, which isn't necessarily required, but may clear up confusion with our custom setup. I also fixed a few errors that were causing the benchmarks to fail to compile. Inafc8d33a87
I ran `rustfmt` on all of the benchmarks. Ind6cdf960ab
I fixed all of the Clippy warnings. Inee94d48f50
I fixed some of the benchmarks' usage of `black_box()`. I ended up opening https://github.com/rust-lang/rust/pull/133942 due to this, which should help prevent this in the future. Incbe1688dcd
I renamed all of the ECS benchmark groups to be called `benches`, to be consistent with the other crate benchmarks. Ine701c212cd
and8815bb78b0
I re-ordered some imports and module definitions, and uplifted `fragmentation/mod.rs` to `fragementation.rs`. Finally, inb0065e0b0b
I organized `Cargo.toml` and bumped Criterion to v0.5. ## Testing - `cd benches && cargo clippy --benches` - `cd benches && cargo fmt --all`
23 lines
411 B
Rust
23 lines
411 B
Rust
mod run_condition;
|
|
mod running_systems;
|
|
mod schedule;
|
|
|
|
use criterion::criterion_group;
|
|
use run_condition::*;
|
|
use running_systems::*;
|
|
use schedule::*;
|
|
|
|
criterion_group!(
|
|
benches,
|
|
run_condition_yes,
|
|
run_condition_no,
|
|
run_condition_yes_with_query,
|
|
run_condition_yes_with_resource,
|
|
empty_systems,
|
|
busy_systems,
|
|
contrived,
|
|
schedule,
|
|
build_schedule,
|
|
empty_schedule_run,
|
|
);
|