aboutsummaryrefslogtreecommitdiff
path: root/src/tests/example_mapping/benches/main.rs
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-02-27 09:41:29 +0000
committerAria Shrimpton <me@aria.rip>2024-02-27 09:41:29 +0000
commit4944cba55324d2dc603aa8e4c6832e0bf2a87147 (patch)
treeff831b54e5318f0b2a8a2b8ef5120f3d196954f7 /src/tests/example_mapping/benches/main.rs
parentfad685c53308f9fd7a449f23d5123ee56080e51b (diff)
add mapping example benchmark
Diffstat (limited to 'src/tests/example_mapping/benches/main.rs')
-rw-r--r--src/tests/example_mapping/benches/main.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tests/example_mapping/benches/main.rs b/src/tests/example_mapping/benches/main.rs
new file mode 100644
index 0000000..e681a68
--- /dev/null
+++ b/src/tests/example_mapping/benches/main.rs
@@ -0,0 +1,16 @@
+use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
+
+fn run_benches(c: &mut Criterion) {
+ for size in [500, 10_000, 50_000].iter() {
+ c.bench_with_input(
+ BenchmarkId::new("example_mapping-insert_get", size),
+ size,
+ |b, &n| {
+ b.iter(|| example_mapping::insert_get(n));
+ },
+ );
+ }
+}
+
+criterion_group!(benches, run_benches);
+criterion_main!(benches);