refactor: run rustfmt

This commit is contained in:
BD103 2024-12-04 11:21:22 -05:00
parent 5d26f56eb9
commit afc8d33a87
11 changed files with 17 additions and 30 deletions

View file

@ -1,11 +1,11 @@
use criterion::*; use criterion::*;
mod add_remove;
mod add_remove_big_sparse_set; mod add_remove_big_sparse_set;
mod add_remove_big_table; mod add_remove_big_table;
mod add_remove_sparse_set; mod add_remove_sparse_set;
mod add_remove_table; mod add_remove_table;
mod add_remove_very_big_table; mod add_remove_very_big_table;
mod add_remove;
mod archetype_updates; mod archetype_updates;
mod insert_simple; mod insert_simple;
mod insert_simple_unbatched; mod insert_simple_unbatched;

View file

@ -1,8 +1,8 @@
use bevy_ecs::prelude::*; use bevy_ecs::prelude::*;
use bevy_ecs::system::SystemState; use bevy_ecs::system::SystemState;
use core::hint::black_box;
use criterion::*; use criterion::*;
use glam::*; use glam::*;
use core::hint::black_box;
criterion_group!(fragmentation_benches, iter_frag_empty); criterion_group!(fragmentation_benches, iter_frag_empty);

View file

@ -1,4 +1,7 @@
#![expect(dead_code, reason = "Many fields are unused/unread as they are just for benchmarking purposes.")] #![expect(
dead_code,
reason = "Many fields are unused/unread as they are just for benchmarking purposes."
)]
use criterion::criterion_main; use criterion::criterion_main;

View file

@ -2,6 +2,4 @@ use criterion::criterion_main;
mod bezier; mod bezier;
criterion_main!( criterion_main!(bezier::benches);
bezier::benches,
);

View file

@ -2,6 +2,4 @@ use criterion::criterion_main;
mod ray_mesh_intersection; mod ray_mesh_intersection;
criterion_main!( criterion_main!(ray_mesh_intersection::benches);
ray_mesh_intersection::benches,
);

View file

@ -2,8 +2,8 @@ use core::{iter, time::Duration};
use bevy_reflect::{DynamicList, List}; use bevy_reflect::{DynamicList, List};
use criterion::{ use criterion::{
black_box, criterion_group, measurement::Measurement, BatchSize, black_box, criterion_group, measurement::Measurement, BatchSize, BenchmarkGroup, BenchmarkId,
BenchmarkGroup, BenchmarkId, Criterion, Throughput, Criterion, Throughput,
}; };
criterion_group!( criterion_group!(

View file

@ -3,8 +3,8 @@ use core::{fmt::Write, iter, time::Duration};
use bevy_reflect::{DynamicMap, Map}; use bevy_reflect::{DynamicMap, Map};
use bevy_utils::HashMap; use bevy_utils::HashMap;
use criterion::{ use criterion::{
black_box, criterion_group, measurement::Measurement, BatchSize, black_box, criterion_group, measurement::Measurement, BatchSize, BenchmarkGroup, BenchmarkId,
BenchmarkGroup, BenchmarkId, Criterion, Throughput, Criterion, Throughput,
}; };
criterion_group!( criterion_group!(

View file

@ -1,9 +1,7 @@
use core::{fmt::Write, str, time::Duration}; use core::{fmt::Write, str, time::Duration};
use bevy_reflect::ParsedPath; use bevy_reflect::ParsedPath;
use criterion::{ use criterion::{black_box, criterion_group, BatchSize, BenchmarkId, Criterion, Throughput};
black_box, criterion_group, BatchSize, BenchmarkId, Criterion, Throughput,
};
use rand::{distributions::Uniform, Rng, SeedableRng}; use rand::{distributions::Uniform, Rng, SeedableRng};
use rand_chacha::ChaCha8Rng; use rand_chacha::ChaCha8Rng;

View file

@ -1,9 +1,7 @@
use core::time::Duration; use core::time::Duration;
use bevy_reflect::{DynamicStruct, GetField, PartialReflect, Reflect, Struct}; use bevy_reflect::{DynamicStruct, GetField, PartialReflect, Reflect, Struct};
use criterion::{ use criterion::{black_box, criterion_group, BatchSize, BenchmarkId, Criterion, Throughput};
black_box, criterion_group, BatchSize, BenchmarkId, Criterion, Throughput,
};
criterion_group!( criterion_group!(
benches, benches,

View file

@ -3,7 +3,4 @@ use criterion::criterion_main;
mod render_layers; mod render_layers;
mod torus; mod torus;
criterion_main!( criterion_main!(render_layers::benches, torus::benches);
render_layers::benches,
torus::benches,
);

View file

@ -6,13 +6,8 @@ fn render_layers(c: &mut Criterion) {
c.bench_function("layers_intersect", |b| { c.bench_function("layers_intersect", |b| {
let layer_a = RenderLayers::layer(1).with(2); let layer_a = RenderLayers::layer(1).with(2);
let layer_b = RenderLayers::layer(1); let layer_b = RenderLayers::layer(1);
b.iter(|| { b.iter(|| black_box(layer_a.intersects(&layer_b)));
black_box(layer_a.intersects(&layer_b))
});
}); });
} }
criterion_group!( criterion_group!(benches, render_layers);
benches,
render_layers,
);