@@ -14,6 +14,7 @@ import {
1414 computeCompileComparisonsWithNonRelevant ,
1515 createCompileBenchmarkMap ,
1616 defaultCompileFilter ,
17+ transformDataForBackendComparison ,
1718} from " ./common" ;
1819import {BenchmarkInfo } from " ../../../api" ;
1920import {importantCompileMetrics } from " ../metrics" ;
@@ -197,15 +198,31 @@ const urlParams = getUrlParams();
197198const quickLinksKey = ref (0 );
198199const filter = ref (loadFilterFromUrl (urlParams , defaultCompileFilter ));
199200
201+ // Should we use the backend as the source of before/after data?
202+ const selfCompareBackend = ref (false );
203+
200204function exportData() {
201205 exportToMarkdown (comparisons .value , filter .value .showRawData );
202206}
203207
208+ // Are we currently comparing the same commit against each other?
209+ const comparesIdenticalCommits = computed (() => {
210+ return props .data .a .commit === props .data .b .commit ;
211+ });
204212const benchmarkMap = createCompileBenchmarkMap (props .data );
213+
214+ // Artificially restructure the data to create a comparison between backends
215+ const compileComparisons = computed (() => {
216+ if (selfCompareBackend .value ) {
217+ return transformDataForBackendComparison (props .data .compile_comparisons );
218+ } else {
219+ return props .data .compile_comparisons ;
220+ }
221+ });
205222const allComparisons = computed (() =>
206223 computeCompileComparisonsWithNonRelevant (
207224 filter .value ,
208- props . data . compile_comparisons ,
225+ compileComparisons . value ,
209226 benchmarkMap
210227 )
211228);
@@ -222,6 +239,9 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
222239 :selected-metric =" selector.stat"
223240 :metrics =" benchmarkInfo.compile_metrics"
224241 />
242+ <div v-if =" comparesIdenticalCommits" >
243+ Self-compare backend: <input type =" checkbox" v-model =" selfCompareBackend" />
244+ </div >
225245 <Filters
226246 :defaultFilter =" defaultCompileFilter"
227247 :initialFilter =" filter"
@@ -230,6 +250,9 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
230250 />
231251 <OverallSummary :summary =" filteredSummary" />
232252 <Aggregations :cases =" comparisons" />
253+ <div class =" warning" v-if =" selfCompareBackend" >
254+ Comparing LLVM against Cranelift!
255+ </div >
233256 <Benchmarks
234257 :data =" data"
235258 :test-cases =" comparisons"
@@ -239,3 +262,9 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
239262 :benchmark-map =" benchmarkMap"
240263 ></Benchmarks >
241264</template >
265+ <style lang="scss" scoped>
266+ .warning {
267+ color : red ;
268+ font-weight : bold ;
269+ }
270+ </style >
0 commit comments