Moved benchmarks to a single place (#1477)

Closes #1472.
This commit is contained in:
Yoh Deadfall 2021-02-19 22:11:00 +00:00
parent 041fd27b0a
commit 578a5b1b88
5 changed files with 12 additions and 56 deletions

View file

@ -8,6 +8,17 @@ edition = "2018"
criterion = "0.3"
bevy = { path = "../" }
[[bench]]
name = "bench"
path = "benches/bevy_ecs/bench.rs"
harness = false
required-features = ["macros"]
[[bench]]
name = "system_stage"
path = "benches/bevy_ecs/stages.rs"
harness = false
[[bench]]
name = "iter"
path = "benches/bevy_tasks/iter.rs"

View file

@ -1,4 +1,4 @@
use bevy_ecs::{prelude::*, Stage};
use bevy::ecs::{IntoSystem,World,SystemStage,Resources,Query,Stage};
use criterion::{criterion_group, criterion_main, Criterion};
criterion_group!(benches, empty_systems, busy_systems, contrived);

View file

@ -34,12 +34,3 @@ lazy_static = { version = "1.4.0" }
[dev-dependencies]
bencher = "0.1.5"
criterion = "0.3"
[[bench]]
name = "bench"
harness = false
required-features = ["macros"]
[[bench]]
name = "system_stage"
harness = false

View file

@ -1,46 +0,0 @@
// #![feature(test)]
// extern crate test;
// use legion::prelude::*;
// use bevy_transform::{transform_system, prelude::*};
// use test::Bencher;
// #[bench]
// fn transform_update_without_change(b: &mut Bencher) {
// let _ = env_logger::builder().is_test(true).try_init();
// let mut world = Universe::new().create_world();
// let system = transform_system::build(&mut world);
// let ltw = LocalToWorld::identity();
// let t = Translation::new(1.0, 2.0, 3.0);
// let r = Rotation::from_euler_angles(1.0, 2.0, 3.0);
// let s = Scale(2.0);
// let nus = NonUniformScale::new(1.0, 2.0, 3.0);
// // Add N of every combination of transform types.
// let n = 1000;
// let _translation = *world.insert((), vec![(ltw, t); n]).first().unwrap();
// let _rotation = *world.insert((), vec![(ltw, r); n]).first().unwrap();
// let _scale = *world.insert((), vec![(ltw, s); n]).first().unwrap();
// let _non_uniform_scale = *world.insert((), vec![(ltw, nus); n]).first().unwrap();
// let _translation_and_rotation = *world.insert((), vec![(ltw, t, r); n]).first().unwrap();
// let _translation_and_scale = *world.insert((), vec![(ltw, t, s); n]).first().unwrap();
// let _translation_and_nus = *world.insert((), vec![(ltw, t, nus); n]).first().unwrap();
// let _rotation_scale = *world.insert((), vec![(ltw, r, s); n]).first().unwrap();
// let _rotation_nus = *world.insert((), vec![(ltw, r, nus); n]).first().unwrap();
// let _translation_rotation_scale = *world.insert((), vec![(ltw, t, r, s); n]).first().unwrap();
// let _translation_rotation_nus = *world.insert((), vec![(ltw, t, r, nus); n]).first().unwrap();
// // Run the system once outside the test (which should compute everything and it shouldn't be
// // touched again).
// system.run(&mut world);
// system.command_buffer_mut().write(&mut world);
// // Then time the already-computed updates.
// b.iter(|| {
// system.run(&mut world);
// system.command_buffer_mut().write(&mut world);
// });
// }