Skip to content

Commit

Permalink
Apply review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Nov 18, 2024
1 parent e20f90b commit 915e095
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
9 changes: 3 additions & 6 deletions site/frontend/src/pages/compare/compile/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,12 @@ export function transformDataForBackendComparison(
}
}

const transformed = [];
benchmarkMap.forEach((entry) => {
return Array.from(benchmarkMap, ([_, entry]) => {
const comparison: CompileBenchmarkComparison = {
benchmark: entry.benchmark,
profile: entry.profile,
scenario: entry.scenario,
// Treat the backend as LLVM
// Treat LLVM as the baseline
backend: "llvm",
comparison: {
statistics: [entry.llvm, entry.cranelift],
Expand All @@ -260,8 +259,6 @@ export function transformDataForBackendComparison(
significance_threshold: 1.0,
},
};
transformed.push(comparison);
return comparison;
});

return transformed;
}
26 changes: 18 additions & 8 deletions site/frontend/src/pages/compare/compile/compile-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,22 +216,28 @@ const quickLinksKey = ref(0);
const filter = ref(loadFilterFromUrl(urlParams, defaultCompileFilter));
// Should we use the backend as the source of before/after data?
const selfCompareBackend = computed(
() => comparesIdenticalCommits.value && filter.value.selfCompareBackend
);
const selfCompareBackend = computed(() => {
const hasMultipleBackends =
new Set(props.data.compile_comparisons.map((c) => c.backend)).size > 1;
return (
comparesIdenticalCommits.value &&
filter.value.selfCompareBackend &&
hasMultipleBackends
);
});
function exportData() {
exportToMarkdown(comparisons.value, filter.value.showRawData);
}
// Are we currently comparing the same commit against each other?
// Are we currently comparing the same commit in the before/after toolchains?
const comparesIdenticalCommits = computed(() => {
return props.data.a.commit === props.data.b.commit;
});
const benchmarkMap = createCompileBenchmarkMap(props.data);
// Artificially restructure the data to create a comparison between backends
const compileComparisons = computed(() => {
// If requested, artificially restructure the data to create a comparison between backends
if (selfCompareBackend.value) {
return transformDataForBackendComparison(props.data.compile_comparisons);
} else {
Expand All @@ -258,8 +264,11 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
:selected-metric="selector.stat"
:metrics="benchmarkInfo.compile_metrics"
/>
<div v-if="comparesIdenticalCommits">
Self-compare backend:
<div
v-if="comparesIdenticalCommits"
:title="`Compare codegen backends for commit '${props.data.a.commit}'`"
>
Compare codegen backends for this commit:
<input
type="checkbox"
:checked="selfCompareBackend"
Expand All @@ -275,7 +284,8 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
<OverallSummary :summary="filteredSummary" />
<Aggregations :cases="comparisons" />
<div class="warning" v-if="selfCompareBackend">
Comparing Cranelift against LLVM baseline!
Note: comparing results of the baseline LLVM backend to the Cranelift
backend.
</div>
<Benchmarks
:data="data"
Expand Down

0 comments on commit 915e095

Please sign in to comment.