Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions benches/benches/core/cmap2/basic_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ fn get_sparse_map(n_square: usize) -> CMap2<FloatType> {
map.remove_free_dart(5);
// because of the way we built the map in the square_cmap2 function & the ID computation
// policy, we can safely remove a vertex we know is defined
assert_eq!(map.remove_vertex(1).unwrap(), Vertex2::from((0.0, 0.0)));
assert_eq!(
map.force_remove_vertex(1).unwrap(),
Vertex2::from((0.0, 0.0))
);
map
}

Expand Down Expand Up @@ -109,23 +112,23 @@ library_benchmark_group!(
#[bench::medium(&mut get_map(64))]
#[bench::large(&mut get_map(256))]
fn read_vertex(map: &mut CMap2<FloatType>) -> Option<Vertex2<FloatType>> {
black_box(map.vertex(1))
black_box(map.force_read_vertex(1))
}

#[library_benchmark]
#[bench::small(&mut get_sparse_map(16))]
#[bench::medium(&mut get_sparse_map(64))]
#[bench::large(&mut get_sparse_map(256))]
fn read_missing_vertex(map: &mut CMap2<FloatType>) -> Option<Vertex2<FloatType>> {
black_box(map.vertex(1))
black_box(map.force_read_vertex(1))
}

#[library_benchmark]
#[bench::small(&mut get_sparse_map(16))]
#[bench::medium(&mut get_sparse_map(64))]
#[bench::large(&mut get_sparse_map(256))]
fn insert_vertex(map: &mut CMap2<FloatType>) {
map.insert_vertex(1, (0.0, 0.0));
map.force_write_vertex(1, (0.0, 0.0));
black_box(map);
}

Expand All @@ -134,31 +137,31 @@ fn insert_vertex(map: &mut CMap2<FloatType>) {
#[bench::medium(&mut get_map(64))]
#[bench::large(&mut get_map(256))]
fn replace_vertex(map: &mut CMap2<FloatType>) -> Option<Vertex2<FloatType>> {
black_box(map.replace_vertex(1, (0.0, 0.0)))
black_box(map.force_write_vertex(1, (0.0, 0.0)))
}

#[library_benchmark]
#[bench::small(&mut get_sparse_map(16))]
#[bench::medium(&mut get_sparse_map(64))]
#[bench::large(&mut get_sparse_map(256))]
fn set_vertex(map: &mut CMap2<FloatType>) -> Option<Vertex2<FloatType>> {
black_box(map.replace_vertex(1, (0.0, 0.0)))
black_box(map.force_write_vertex(1, (0.0, 0.0)))
}

#[library_benchmark]
#[bench::small(&mut get_map(16))]
#[bench::medium(&mut get_map(64))]
#[bench::large(&mut get_map(256))]
fn remove_vertex(map: &mut CMap2<FloatType>) -> Option<Vertex2<FloatType>> {
black_box(map.remove_vertex(1))
black_box(map.force_remove_vertex(1))
}

#[library_benchmark]
#[bench::small(&mut get_sparse_map(16))]
#[bench::medium(&mut get_sparse_map(64))]
#[bench::large(&mut get_sparse_map(256))]
fn remove_missing_vertex(map: &mut CMap2<FloatType>) -> Option<Vertex2<FloatType>> {
black_box(map.remove_vertex(1))
black_box(map.force_remove_vertex(1))
}

library_benchmark_group!(
Expand Down
4 changes: 2 additions & 2 deletions benches/benches/core/cmap2/link_and_sew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ fn get_sew_map(n_square: usize) -> CMap2<FloatType> {
.n_darts(n_square.pow(2) * 4)
.build()
.unwrap();
map.insert_vertex(4, (0.0, 0.0));
map.insert_vertex(6, (1.0, 0.0));
map.force_write_vertex(4, (0.0, 0.0));
map.force_write_vertex(6, (1.0, 0.0));
map
}

Expand Down
Loading