Skip to content

Commit 04f9ce7

Browse files
committed
Upgrade criterion
1 parent 687a1c4 commit 04f9ce7

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

Cargo.lock

Lines changed: 12 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

splashsurf_lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fern = "0.7"
6262
chrono = "0.4"
6363

6464
[dev-dependencies]
65-
criterion = "0.5.1"
65+
criterion = "0.6"
6666
ultraviolet = "0.10"
6767
sdfu = { git = "https://github.com/w1th0utnam3/sdfu", features = [
6868
"ultraviolet",

splashsurf_lib/benches/benches/bench_mesh.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn mesh_vertex_normals(c: &mut Criterion) {
4545
group.bench_function("mesh_vertex_normals", |b| {
4646
b.iter(|| {
4747
let normals = mesh.vertex_normals();
48-
criterion::black_box(normals)
48+
std::hint::black_box(normals)
4949
})
5050
});
5151

@@ -65,7 +65,7 @@ pub fn mesh_vertex_normals_parallel(c: &mut Criterion) {
6565
group.bench_function("mesh_vertex_normals_parallel", |b| {
6666
b.iter(|| {
6767
let normals = mesh.par_vertex_normals();
68-
criterion::black_box(normals)
68+
std::hint::black_box(normals)
6969
})
7070
});
7171

splashsurf_lib/benches/benches/bench_subdomain_grid.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use splashsurf_lib::{
77
};
88
use std::time::Duration;
99

10+
static CANYON_PATH: &str = "C:\\canyon.xyz";
11+
1012
fn parameters_canyon() -> Parameters<f32> {
1113
let particle_radius = 0.011;
1214
let compact_support_radius = 4.0 * particle_radius;
@@ -31,7 +33,7 @@ fn parameters_canyon() -> Parameters<f32> {
3133
}
3234

3335
pub fn grid_canyon(c: &mut Criterion) {
34-
let particle_positions: &Vec<Vector3<f32>> = &particles_from_file("C:\\canyon.xyz").unwrap();
36+
let particle_positions: &Vec<Vector3<f32>> = &particles_from_file(CANYON_PATH).unwrap();
3537
let parameters = parameters_canyon();
3638

3739
let mut group = c.benchmark_group("grid_canyon");
@@ -89,7 +91,7 @@ pub fn grid_canyon(c: &mut Criterion) {
8991
}
9092

9193
pub fn grid_optimal_num_cubes_canyon(c: &mut Criterion) {
92-
let particle_positions: &Vec<Vector3<f32>> = &particles_from_file("C:\\canyon.xyz").unwrap();
94+
let particle_positions: &Vec<Vector3<f32>> = &particles_from_file(CANYON_PATH).unwrap();
9395
let mut parameters = parameters_canyon();
9496

9597
let mut with_cube_factor = |cube_factor: f32, num_cubes: &[u32]| {

0 commit comments

Comments
 (0)