Skip to content

Commit

Permalink
Merge a9decd1 into a7708ec
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Jul 18, 2020
2 parents a7708ec + a9decd1 commit 8a5f3fc
Show file tree
Hide file tree
Showing 5 changed files with 352 additions and 0 deletions.
8 changes: 8 additions & 0 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use self::setup::{
generate_test_strings,
BackendBenchmark,
BenchBucket,
BenchBucket2,
BenchSimple,
BenchString,
BENCH_LEN_STRINGS,
Expand Down Expand Up @@ -77,6 +78,7 @@ fn bench_get_or_intern_static(c: &mut Criterion) {
}
bench_for_backend::<BenchSimple>(&mut g);
bench_for_backend::<BenchBucket>(&mut g);
bench_for_backend::<BenchBucket2>(&mut g);
bench_for_backend::<BenchString>(&mut g);
}

Expand All @@ -103,6 +105,7 @@ fn bench_get_or_intern_fill_with_capacity(c: &mut Criterion) {
}
bench_for_backend::<BenchSimple>(&mut g);
bench_for_backend::<BenchBucket>(&mut g);
bench_for_backend::<BenchBucket2>(&mut g);
bench_for_backend::<BenchString>(&mut g);
}

Expand All @@ -129,6 +132,7 @@ fn bench_get_or_intern_fill(c: &mut Criterion) {
}
bench_for_backend::<BenchSimple>(&mut g);
bench_for_backend::<BenchBucket>(&mut g);
bench_for_backend::<BenchBucket2>(&mut g);
bench_for_backend::<BenchString>(&mut g);
}

Expand All @@ -155,6 +159,7 @@ fn bench_get_or_intern_already_filled(c: &mut Criterion) {
}
bench_for_backend::<BenchSimple>(&mut g);
bench_for_backend::<BenchBucket>(&mut g);
bench_for_backend::<BenchBucket2>(&mut g);
bench_for_backend::<BenchString>(&mut g);
}

Expand All @@ -181,6 +186,7 @@ fn bench_resolve_already_filled(c: &mut Criterion) {
}
bench_for_backend::<BenchSimple>(&mut g);
bench_for_backend::<BenchBucket>(&mut g);
bench_for_backend::<BenchBucket2>(&mut g);
bench_for_backend::<BenchString>(&mut g);
}

Expand All @@ -207,6 +213,7 @@ fn bench_get_already_filled(c: &mut Criterion) {
}
bench_for_backend::<BenchSimple>(&mut g);
bench_for_backend::<BenchBucket>(&mut g);
bench_for_backend::<BenchBucket2>(&mut g);
bench_for_backend::<BenchString>(&mut g);
}

Expand Down Expand Up @@ -237,5 +244,6 @@ fn bench_iter_already_filled(c: &mut Criterion) {
}
bench_for_backend::<BenchSimple>(&mut g);
bench_for_backend::<BenchBucket>(&mut g);
bench_for_backend::<BenchBucket2>(&mut g);
bench_for_backend::<BenchString>(&mut g);
}
7 changes: 7 additions & 0 deletions benches/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use string_interner::{
backend::{
Backend,
BucketBackend,
BucketBackend2,
SimpleBackend,
StringBackend,
},
Expand Down Expand Up @@ -122,6 +123,12 @@ impl BackendBenchmark for BenchBucket {
type Backend = BucketBackend<DefaultSymbol>;
}

pub struct BenchBucket2;
impl BackendBenchmark for BenchBucket2 {
const NAME: &'static str = "BucketBackend2";
type Backend = BucketBackend2<DefaultSymbol>;
}

pub struct BenchSimple;
impl BackendBenchmark for BenchSimple {
const NAME: &'static str = "SimpleBackend";
Expand Down
Loading

0 comments on commit 8a5f3fc

Please sign in to comment.