@@ -14,6 +14,7 @@ import {
14
14
computeCompileComparisonsWithNonRelevant ,
15
15
createCompileBenchmarkMap ,
16
16
defaultCompileFilter ,
17
+ transformDataForBackendComparison ,
17
18
} from " ./common" ;
18
19
import {BenchmarkInfo } from " ../../../api" ;
19
20
import {importantCompileMetrics } from " ../metrics" ;
@@ -197,15 +198,31 @@ const urlParams = getUrlParams();
197
198
const quickLinksKey = ref (0 );
198
199
const filter = ref (loadFilterFromUrl (urlParams , defaultCompileFilter ));
199
200
201
+ // Should we use the backend as the source of before/after data?
202
+ const selfCompareBackend = ref (false );
203
+
200
204
function exportData() {
201
205
exportToMarkdown (comparisons .value , filter .value .showRawData );
202
206
}
203
207
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
+ });
204
212
const 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
+ });
205
222
const allComparisons = computed (() =>
206
223
computeCompileComparisonsWithNonRelevant (
207
224
filter .value ,
208
- props . data . compile_comparisons ,
225
+ compileComparisons . value ,
209
226
benchmarkMap
210
227
)
211
228
);
@@ -222,6 +239,9 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
222
239
:selected-metric =" selector.stat"
223
240
:metrics =" benchmarkInfo.compile_metrics"
224
241
/>
242
+ <div v-if =" comparesIdenticalCommits" >
243
+ Self-compare backend: <input type =" checkbox" v-model =" selfCompareBackend" />
244
+ </div >
225
245
<Filters
226
246
:defaultFilter =" defaultCompileFilter"
227
247
:initialFilter =" filter"
@@ -230,6 +250,9 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
230
250
/>
231
251
<OverallSummary :summary =" filteredSummary" />
232
252
<Aggregations :cases =" comparisons" />
253
+ <div class =" warning" v-if =" selfCompareBackend" >
254
+ Comparing LLVM against Cranelift!
255
+ </div >
233
256
<Benchmarks
234
257
:data =" data"
235
258
:test-cases =" comparisons"
@@ -239,3 +262,9 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
239
262
:benchmark-map =" benchmarkMap"
240
263
></Benchmarks >
241
264
</template >
265
+ <style lang="scss" scoped>
266
+ .warning {
267
+ color : red ;
268
+ font-weight : bold ;
269
+ }
270
+ </style >
0 commit comments