mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Use parameterized benchmarks as references
This commit is contained in:
1 parent
5d501b62f9
commit
f7429e2fb2
13 files changed
+856
-71
No files matched your search
+10
-2
@@ -51,6 +51,7 @@ trait Exporter {
|
||||
results: &[BenchmarkResult],
|
||||
unit: Option<TimeUnit>,
|
||||
sort_order: SortOrder,
|
||||
reference_index: Option<usize>,
|
||||
) -> Result<Vec<u8>>;
|
||||
}
|
||||
|
||||
@@ -130,11 +131,18 @@ impl ExportManager {
|
||||
/// results are written to all file targets (to always have them up to date, even
|
||||
/// if a benchmark fails). In the latter case, we only print to stdout targets (in
|
||||
/// order not to clutter the output of hyperfine with intermediate results).
|
||||
pub fn write_results(&self, results: &[BenchmarkResult], intermediate: bool) -> Result<()> {
|
||||
/// `reference_index` refers to the complete benchmark sequence, so it can
|
||||
/// point past `results` while that benchmark is still pending.
|
||||
pub fn write_results(
|
||||
&self,
|
||||
results: &[BenchmarkResult],
|
||||
intermediate: bool,
|
||||
reference_index: Option<usize>,
|
||||
) -> Result<()> {
|
||||
for e in &self.exporters {
|
||||
let content = || {
|
||||
e.exporter
|
||||
.serialize(results, self.time_unit, self.sort_order)
|
||||
.serialize(results, self.time_unit, self.sort_order, reference_index)
|
||||
};
|
||||
|
||||
match e.target {
|
||||
|
||||
Reference in new issue
Block a user