Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tamer/benches/sym.rs')
-rw-r--r--tamer/benches/sym.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tamer/benches/sym.rs b/tamer/benches/sym.rs
index b5f0320..120b10e 100644
--- a/tamer/benches/sym.rs
+++ b/tamer/benches/sym.rs
@@ -107,6 +107,21 @@ mod interner {
});
}
+ #[bench]
+ fn index_lookup_unique_1000(bench: &mut Bencher) {
+ let sut = ArenaInterner::<RandomState>::new();
+ let strs = gen_strs(1000);
+
+ let syms = strs
+ .iter()
+ .map(|s| sut.intern(s).index())
+ .collect::<Vec<_>>();
+
+ bench.iter(|| {
+ syms.iter().map(|si| sut.index_lookup(*si)).for_each(drop);
+ });
+ }
+
mod fx {
use super::*;
use fxhash::FxBuildHasher;