Bench sub.
Improve performance for sub.
This commit is contained in:
@@ -33,11 +33,20 @@ fn insert(data: &[u64]) {
|
||||
}
|
||||
}
|
||||
|
||||
fn sub(a: &BitSet, b: &BitSet) {
|
||||
a - b;
|
||||
}
|
||||
|
||||
fn criterion_benchmark(c: &mut Criterion) {
|
||||
let data: Vec<_> = default_set(1000);
|
||||
|
||||
c.bench_function("contains", |b| b.iter(|| contains(&data)));
|
||||
c.bench_function("insert", |b| b.iter(|| insert(&data)));
|
||||
|
||||
let lhs: BitSet = default_set(1000);
|
||||
let rhs: BitSet = default_set(1000);
|
||||
|
||||
c.bench_function("sub", |b| b.iter(|| sub(&lhs, &rhs)));
|
||||
}
|
||||
|
||||
criterion_group!(benches, criterion_benchmark);
|
||||
|
||||
Reference in New Issue
Block a user