Run bench only once for each random input
Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
This commit is contained in:
parent
d81382b29a
commit
ed1d38f5da
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ fn generate_zip32_archive_with_random_comment(comment_length: usize) -> ZipResul
|
||||||
fn parse_archive_with_comment(bench: &mut Bencher) {
|
fn parse_archive_with_comment(bench: &mut Bencher) {
|
||||||
let bytes = generate_zip32_archive_with_random_comment(COMMENT_SIZE).unwrap();
|
let bytes = generate_zip32_archive_with_random_comment(COMMENT_SIZE).unwrap();
|
||||||
|
|
||||||
bench.iter(|| {
|
bench.bench_n(1, || {
|
||||||
let archive = ZipArchive::new(Cursor::new(bytes.as_slice())).unwrap();
|
let archive = ZipArchive::new(Cursor::new(bytes.as_slice())).unwrap();
|
||||||
archive.comment().len()
|
archive.comment().len()
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue