File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed
site/frontend/src/pages/compare/compile Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ export type CompileBenchmarkFilter = {
27
27
binary : boolean ;
28
28
library : boolean ;
29
29
} ;
30
+ changes : {
31
+ regressions : boolean ;
32
+ improvements : boolean ;
33
+ } ;
30
34
selfCompareBackend : boolean ;
31
35
} & BenchmarkFilter ;
32
36
@@ -58,6 +62,10 @@ export const defaultCompileFilter: CompileBenchmarkFilter = {
58
62
binary : true ,
59
63
library : true ,
60
64
} ,
65
+ changes : {
66
+ regressions : true ,
67
+ improvements : true ,
68
+ } ,
61
69
selfCompareBackend : false ,
62
70
} ;
63
71
@@ -154,6 +162,16 @@ export function computeCompileComparisonsWithNonRelevant(
154
162
return true ;
155
163
}
156
164
165
+ function changeFilter (
166
+ comparison : TestCaseComparison < CompileTestCase >
167
+ ) : boolean {
168
+ const isImprovement = comparison . percent <= 0.0 ;
169
+ if ( isImprovement && ! filter . changes . improvements ) return false ;
170
+ if ( ! isImprovement && ! filter . changes . regressions ) return false ;
171
+
172
+ return true ;
173
+ }
174
+
157
175
function categoryFilter ( category : Category ) {
158
176
if ( category === "primary" && ! filter . category . primary ) return false ;
159
177
if ( category === "secondary" && ! filter . category . secondary ) return false ;
@@ -167,6 +185,7 @@ export function computeCompileComparisonsWithNonRelevant(
167
185
backendFilter ( comparison . testCase . backend ) &&
168
186
categoryFilter ( comparison . testCase . category ) &&
169
187
artifactFilter ( benchmarkMap [ comparison . testCase . benchmark ] ?? null ) &&
188
+ changeFilter ( comparison ) &&
170
189
benchmarkNameMatchesFilter ( comparison . testCase . benchmark , filter . name )
171
190
) ;
172
191
}
Original file line number Diff line number Diff line change @@ -102,6 +102,18 @@ function loadFilterFromUrl(
102
102
defaultFilter .artifact .library
103
103
),
104
104
},
105
+ changes: {
106
+ regressions: getBoolOrDefault (
107
+ urlParams ,
108
+ " regressions" ,
109
+ defaultFilter .changes .regressions
110
+ ),
111
+ improvements: getBoolOrDefault (
112
+ urlParams ,
113
+ " improvements" ,
114
+ defaultCompileFilter .changes .improvements
115
+ ),
116
+ },
105
117
selfCompareBackend: getBoolOrDefault (
106
118
urlParams ,
107
119
" selfCompareBackend" ,
@@ -178,6 +190,16 @@ function storeFilterToUrl(
178
190
filter .artifact .library ,
179
191
defaultFilter .artifact .library
180
192
);
193
+ storeOrReset (
194
+ " regressions" ,
195
+ filter .changes .regressions ,
196
+ defaultFilter .changes .regressions
197
+ );
198
+ storeOrReset (
199
+ " improvements" ,
200
+ filter .changes .improvements ,
201
+ defaultFilter .changes .improvements
202
+ );
181
203
storeOrReset (
182
204
" selfCompareBackend" ,
183
205
filter .selfCompareBackend ,
Original file line number Diff line number Diff line change @@ -259,6 +259,33 @@ const opened = createPersistedRef(PREF_FILTERS_OPENED);
259
259
</li >
260
260
</ul >
261
261
</div >
262
+ <div class =" section section-list-wrapper" >
263
+ <div class =" section-heading" >
264
+ <div style =" width : 160px " >
265
+ <span >Changes</span >
266
+ <Tooltip >
267
+ Select only improvements, only regressions, or both.
268
+ </Tooltip >
269
+ </div >
270
+ </div >
271
+ <ul class =" states-list" >
272
+ <li >
273
+ <label >
274
+ <input type =" checkbox" v-model =" filter.changes.regressions" />
275
+ <span class =" label" >regressions</span >
276
+ </label >
277
+ </li >
278
+ <li >
279
+ <label >
280
+ <input
281
+ type =" checkbox"
282
+ v-model =" filter.changes.improvements"
283
+ />
284
+ <span class =" label" >improvements</span >
285
+ </label >
286
+ </li >
287
+ </ul >
288
+ </div >
262
289
<div class =" section" >
263
290
<div class =" section-heading" >
264
291
<span >Show non-relevant results</span >
You can’t perform that action at this time.
0 commit comments