Skip to content

Commit d5a4428

Browse files
Merge pull request #1103 from Mark-Simulacrum/diff-incr-patched
Enable automated diffing for IncrPatched results
2 parents 24e70c0 + 53c28a3 commit d5a4428

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

collector/src/execute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl fmt::Display for BenchmarkName {
159159
pub struct Benchmark {
160160
pub name: BenchmarkName,
161161
pub path: PathBuf,
162-
patches: Vec<Patch>,
162+
pub patches: Vec<Patch>,
163163
config: BenchmarkConfig,
164164
}
165165

collector/src/main.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -519,16 +519,22 @@ fn generate_cachegrind_diffs(
519519
let mut annotated_diffs = Vec::new();
520520
for benchmark in benchmarks {
521521
for &profile_kind in profile_kinds {
522-
for &scenario_kind in scenario_kinds {
523-
if let ScenarioKind::IncrPatched = scenario_kind {
524-
continue;
522+
for scenario_kind in scenario_kinds.iter().flat_map(|kind| {
523+
if profile_kind == ProfileKind::Doc && kind.is_incr() {
524+
return vec![];
525525
}
526-
if profile_kind == ProfileKind::Doc && scenario_kind.is_incr() {
527-
continue;
526+
match kind {
527+
ScenarioKind::Full | ScenarioKind::IncrFull | ScenarioKind::IncrUnchanged => {
528+
vec![format!("{:?}", kind)]
529+
}
530+
ScenarioKind::IncrPatched => (0..benchmark.patches.len())
531+
.map(|i| format!("{:?}{}", kind, i))
532+
.collect::<Vec<_>>(),
528533
}
534+
}) {
529535
let filename = |prefix, id| {
530536
format!(
531-
"{}-{}-{}-{:?}-{:?}",
537+
"{}-{}-{}-{:?}-{}",
532538
prefix, id, benchmark.name, profile_kind, scenario_kind
533539
)
534540
};

0 commit comments

Comments
 (0)