Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@ryansg.com>2020-01-24 11:09:24 -0500
committerMike Gerwitz <mike.gerwitz@ryansg.com>2020-02-25 16:10:55 -0500
commit6aae741162595942021b5d42b26d1ceb458d61ba (patch)
treee7988b8176f5b9e582007934644c855ff13ea27a /tamer/benches/sym.rs
parente8cd378d5952f3ae51d4cfecf29d8f70426de8e9 (diff)
downloadtame-6aae741162595942021b5d42b26d1ceb458d61ba.tar.gz
tame-6aae741162595942021b5d42b26d1ceb458d61ba.tar.bz2
tame-6aae741162595942021b5d42b26d1ceb458d61ba.zip
TAMER (sym::Interner::intern_utf8_unchecked): New function
This removes boilerplate for reading xmlo files. See next commit.
Diffstat (limited to 'tamer/benches/sym.rs')
-rw-r--r--tamer/benches/sym.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tamer/benches/sym.rs b/tamer/benches/sym.rs
index 2e1c894..d96b7d2 100644
--- a/tamer/benches/sym.rs
+++ b/tamer/benches/sym.rs
@@ -148,6 +148,16 @@ mod interner {
});
}
+ #[bench]
+ fn with_one_new_1000_utf8_unchecked(bench: &mut Bencher) {
+ bench.iter(|| {
+ let sut = ArenaInterner::<FxBuildHasher>::new();
+ (0..1000)
+ .map(|_| unsafe { sut.intern_utf8_unchecked(b"first") })
+ .for_each(drop);
+ });
+ }
+
/// Since Fx is the best-performing, let's build upon it to demonstrate
/// the benefits of with_capacity
#[bench]