use divan::Bencher;
use bittern::Arena;
fn main() {
divan::main();
}
#[divan::bench(sample_size = 1000)]
fn compare_symbols(b: Bencher) {
let arena: Arena<str> = Arena::new();
let s1 = arena.intern("hello world");
let s2 = arena.intern("hello world");
b.bench_local(|| {
assert!(s1.is(&s2));
});
}
#[divan::bench(sample_size = 1000)]
fn compare_strings(b: Bencher) {
let s1 = "hello world";
let s2 = "hello world";
b.bench_local(|| {
assert_eq!(s1, s2);
});
}