forked from zcash/orchard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parameterized benchmark group labels with flavor names in note_encryp…
…tion and circuit benchmarks
- Loading branch information
Showing
3 changed files
with
45 additions
and
9 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,28 @@ | ||
use criterion::{measurement::Measurement, BenchmarkGroup, Criterion}; | ||
|
||
use orchard::orchard_flavor::{OrchardFlavor, OrchardVanilla, OrchardZSA}; | ||
|
||
pub(crate) trait OrchardFlavorBench: OrchardFlavor { | ||
fn benchmark_group<'a, M: Measurement>( | ||
c: &'a mut Criterion<M>, | ||
group_name: &str, | ||
) -> BenchmarkGroup<'a, M>; | ||
} | ||
|
||
impl OrchardFlavorBench for OrchardVanilla { | ||
fn benchmark_group<'a, M: Measurement>( | ||
c: &'a mut Criterion<M>, | ||
group_name: &str, | ||
) -> BenchmarkGroup<'a, M> { | ||
c.benchmark_group(format!("[OrchardVanilla] {}", group_name)) | ||
} | ||
} | ||
|
||
impl OrchardFlavorBench for OrchardZSA { | ||
fn benchmark_group<'a, M: Measurement>( | ||
c: &'a mut Criterion<M>, | ||
group_name: &str, | ||
) -> BenchmarkGroup<'a, M> { | ||
c.benchmark_group(format!("[OrchardZSA] {}", group_name)) | ||
} | ||
} |