-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31: Set up benchmarking system r=crepererum a=crepererum See #9 For now limited to a singe benchmark, but it's something. Also hooks up travis to at least compile+execute them. Co-authored-by: Marco Neumann <[email protected]>
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#[macro_use] | ||
extern crate criterion; | ||
extern crate pdatastructs; | ||
|
||
use criterion::Criterion; | ||
use pdatastructs::bloomfilter::BloomFilter; | ||
|
||
fn bloomfilter_add_single(c: &mut Criterion) { | ||
c.bench_function("bloomfilter_add_single", |b| { | ||
let false_positive_rate = 0.02; // = 2% | ||
let expected_elements = 1000; | ||
let mut filter = BloomFilter::with_properties(expected_elements, false_positive_rate); | ||
let obj = "foo bar"; | ||
|
||
b.iter(|| { | ||
filter.add(&obj); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, bloomfilter_add_single); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters