From 6c1ec458663cd3c1027f857e8669928a47a19d16 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Mon, 4 Mar 2024 18:21:48 +0100 Subject: [PATCH] update benchmarks --- sha1-checked/benches/mod.rs | 34 ++++++++++++++++------------------ sha1/benches/mod.rs | 27 --------------------------- 2 files changed, 16 insertions(+), 45 deletions(-) diff --git a/sha1-checked/benches/mod.rs b/sha1-checked/benches/mod.rs index e5d64170e..feeb366d7 100644 --- a/sha1-checked/benches/mod.rs +++ b/sha1-checked/benches/mod.rs @@ -3,6 +3,7 @@ extern crate test; use digest::bench_update; use sha1::Sha1; +use sha1_checked::Sha1 as Sha1Checked; use test::Bencher; bench_update!( @@ -13,29 +14,26 @@ bench_update!( sha1_10000 10000; ); -#[cfg(feature = "collision")] bench_update!( - sha1::checked::Sha1::default(); - sha1_collision_10 10; - sha1_collision_100 100; - sha1_collision_1000 1000; - sha1_collision_10000 10000; + Sha1Checked::default(); + sha1_checked_10 10; + sha1_checked_100 100; + sha1_checked_1000 1000; + sha1_checked_10000 10000; ); -#[cfg(feature = "collision")] bench_update!( - sha1::checked::Sha1::builder().detect_collision(false).build(); - sha1_collision_no_check_10 10; - sha1_collision_no_check_100 100; - sha1_collision_no_check_1000 1000; - sha1_collision_no_check_10000 10000; + Sha1Checked::builder().detect_collision(false).build(); + sha1_checked_no_check_10 10; + sha1_checked_no_check_100 100; + sha1_checked_no_check_1000 1000; + sha1_checked_no_check_10000 10000; ); -#[cfg(feature = "collision")] bench_update!( - sha1::checked::Sha1::builder().use_ubc(false).build(); - sha1_collision_no_ubc_10 10; - sha1_collision_no_ubc_100 100; - sha1_collision_no_ubc_1000 1000; - sha1_collision_no_ubc_10000 10000; + Sha1Checked::builder().use_ubc(false).build(); + sha1_checked_no_ubc_10 10; + sha1_checked_no_ubc_100 100; + sha1_checked_no_ubc_1000 1000; + sha1_checked_no_ubc_10000 10000; ); diff --git a/sha1/benches/mod.rs b/sha1/benches/mod.rs index e5d64170e..5c52e954c 100644 --- a/sha1/benches/mod.rs +++ b/sha1/benches/mod.rs @@ -12,30 +12,3 @@ bench_update!( sha1_1000 1000; sha1_10000 10000; ); - -#[cfg(feature = "collision")] -bench_update!( - sha1::checked::Sha1::default(); - sha1_collision_10 10; - sha1_collision_100 100; - sha1_collision_1000 1000; - sha1_collision_10000 10000; -); - -#[cfg(feature = "collision")] -bench_update!( - sha1::checked::Sha1::builder().detect_collision(false).build(); - sha1_collision_no_check_10 10; - sha1_collision_no_check_100 100; - sha1_collision_no_check_1000 1000; - sha1_collision_no_check_10000 10000; -); - -#[cfg(feature = "collision")] -bench_update!( - sha1::checked::Sha1::builder().use_ubc(false).build(); - sha1_collision_no_ubc_10 10; - sha1_collision_no_ubc_100 100; - sha1_collision_no_ubc_1000 1000; - sha1_collision_no_ubc_10000 10000; -);