diff --git a/benches/Cargo.toml b/benches/Cargo.toml index e64a79d2b3..ee9d45953a 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -17,6 +17,7 @@ bevy_reflect = { path = "../crates/bevy_reflect" } bevy_tasks = { path = "../crates/bevy_tasks" } bevy_utils = { path = "../crates/bevy_utils" } bevy_math = { path = "../crates/bevy_math" } +bevy_render = { path = "../crates/bevy_render" } [profile.release] opt-level = 3 @@ -62,6 +63,11 @@ name = "bezier" path = "benches/bevy_math/bezier.rs" harness = false +[[bench]] +name = "torus" +path = "benches/bevy_render/torus.rs" +harness = false + [[bench]] name = "entity_hash" path = "benches/bevy_ecs/world/entity_hash.rs" diff --git a/benches/benches/bevy_render/torus.rs b/benches/benches/bevy_render/torus.rs new file mode 100644 index 0000000000..8ec81c8040 --- /dev/null +++ b/benches/benches/bevy_render/torus.rs @@ -0,0 +1,15 @@ +use criterion::{black_box, criterion_group, criterion_main, Criterion}; + +use bevy_render::mesh::TorusMeshBuilder; + +fn torus(c: &mut Criterion) { + c.bench_function("build_torus", |b| { + b.iter(|| black_box(TorusMeshBuilder::new(black_box(0.5),black_box(1.0)))); + }); +} + +criterion_group!( + benches, + torus, +); +criterion_main!(benches);