We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 369b324 commit 66a8543Copy full SHA for 66a8543
1 file changed
benches/creation.rs
@@ -65,6 +65,23 @@ fn criterion_benchmark(c: &mut Criterion) {
65
});
66
67
68
+ let s = raft.clone();
69
+ let precomputed_host = hash_str::HashStrHost::new();
70
+ let mut precomputed_cache = hash_str::HashStrCache::new();
71
+ let precomputed: Vec<_> = s
72
+ .iter()
73
+ .map(|s| precomputed_cache.intern_with(&precomputed_host, s))
74
+ .collect();
75
+ c.bench_function("single raft hash_str local precomputed", move |b| {
76
+ let mut cache = hash_str::HashStrCache::new();
77
+ b.iter(|| {
78
+ cache.clear();
79
+ for s in precomputed.iter().cycle().take(100_000) {
80
+ black_box(cache.cache(s));
81
+ }
82
+ });
83
84
+
85
let s = raft.clone();
86
c.bench_function("single raft string-interner", move |b| {
87
b.iter(|| {
0 commit comments