@@ -102,6 +102,11 @@ function loadFilterFromUrl(
102102 defaultFilter .artifact .library
103103 ),
104104 },
105+ selfCompareBackend: getBoolOrDefault (
106+ urlParams ,
107+ " selfCompareBackend" ,
108+ defaultFilter .selfCompareBackend
109+ ),
105110 };
106111}
107112
@@ -173,6 +178,11 @@ function storeFilterToUrl(
173178 filter .artifact .library ,
174179 defaultFilter .artifact .library
175180 );
181+ storeOrReset (
182+ " selfCompareBackend" ,
183+ filter .selfCompareBackend ,
184+ defaultFilter .selfCompareBackend
185+ );
176186
177187 changeUrl (urlParams );
178188}
@@ -183,6 +193,10 @@ function updateFilter(newFilter: CompileBenchmarkFilter) {
183193 refreshQuickLinks ();
184194}
185195
196+ function updateSelfCompareBackend(value : boolean ) {
197+ updateFilter ({... filter .value , selfCompareBackend: value });
198+ }
199+
186200/**
187201 * When the filter changes, the URL is updated.
188202 * After that happens, we want to re-render the quick links component, because
@@ -199,7 +213,9 @@ const quickLinksKey = ref(0);
199213const filter = ref (loadFilterFromUrl (urlParams , defaultCompileFilter ));
200214
201215// Should we use the backend as the source of before/after data?
202- const selfCompareBackend = ref (false );
216+ const selfCompareBackend = computed (
217+ () => comparesIdenticalCommits .value && filter .value .selfCompareBackend
218+ );
203219
204220function exportData() {
205221 exportToMarkdown (comparisons .value , filter .value .showRawData );
@@ -240,7 +256,12 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
240256 :metrics =" benchmarkInfo.compile_metrics"
241257 />
242258 <div v-if =" comparesIdenticalCommits" >
243- Self-compare backend: <input type =" checkbox" v-model =" selfCompareBackend" />
259+ Self-compare backend:
260+ <input
261+ type =" checkbox"
262+ :checked =" selfCompareBackend"
263+ @change =" (e) => updateSelfCompareBackend(e.target.checked)"
264+ />
244265 </div >
245266 <Filters
246267 :defaultFilter =" defaultCompileFilter"
0 commit comments