1
1
<script setup lang="ts">
2
2
import {ref , onMounted , Ref , computed } from " vue" ;
3
- import {
4
- getUrlParams ,
5
- changeUrl
6
- } from " ../../utils/navigation" ;
3
+ import {getUrlParams , changeUrl } from " ../../utils/navigation" ;
7
4
import {postMsgpack } from " ../../utils/requests" ;
8
5
import {SELF_PROFILE_DATA_URL } from " ../../urls" ;
9
6
import {openTraceInPerfetto } from " ../../perfetto" ;
@@ -13,7 +10,7 @@ import {
13
10
createTitleData ,
14
11
createDownloadLinksData ,
15
12
createTableData ,
16
- createArtifactData
13
+ createArtifactData ,
17
14
} from " ./utils" ;
18
15
19
16
const loading = ref (true );
@@ -64,15 +61,23 @@ const tableData = computed(() => {
64
61
aValue = a .executions ;
65
62
bValue = b .executions ;
66
63
// Use percentage change as secondary sort for equal absolute values
67
- aSecondary = a .executionsDelta .hasData ? Math .abs (a .executionsDelta .percentage ) : 0 ;
68
- bSecondary = b .executionsDelta .hasData ? Math .abs (b .executionsDelta .percentage ) : 0 ;
64
+ aSecondary = a .executionsDelta .hasData
65
+ ? Math .abs (a .executionsDelta .percentage )
66
+ : 0 ;
67
+ bSecondary = b .executionsDelta .hasData
68
+ ? Math .abs (b .executionsDelta .percentage )
69
+ : 0 ;
69
70
break ;
70
71
case " incrementalLoading" : // Incremental loading (s)
71
72
aValue = a .incrementalLoading ;
72
73
bValue = b .incrementalLoading ;
73
74
// Use percentage change as secondary sort for equal absolute values
74
- aSecondary = a .incrementalLoadingDelta .hasData ? Math .abs (a .incrementalLoadingDelta .percentage ) : 0 ;
75
- bSecondary = b .incrementalLoadingDelta .hasData ? Math .abs (b .incrementalLoadingDelta .percentage ) : 0 ;
75
+ aSecondary = a .incrementalLoadingDelta .hasData
76
+ ? Math .abs (a .incrementalLoadingDelta .percentage )
77
+ : 0 ;
78
+ bSecondary = b .incrementalLoadingDelta .hasData
79
+ ? Math .abs (b .incrementalLoadingDelta .percentage )
80
+ : 0 ;
76
81
break ;
77
82
case " timePercent" : // Time (%)
78
83
aValue = a .timePercent .value ;
@@ -86,18 +91,34 @@ const tableData = computed(() => {
86
91
bSecondary = b .timeDelta .hasData ? Math .abs (b .timeDelta .percentage ) : 0 ;
87
92
break ;
88
93
case " executionsDelta" : // Executions delta
89
- aValue = a .executionsDelta .hasData ? a .executionsDelta .value : - Infinity ;
90
- bValue = b .executionsDelta .hasData ? b .executionsDelta .value : - Infinity ;
94
+ aValue = a .executionsDelta .hasData
95
+ ? a .executionsDelta .value
96
+ : - Infinity ;
97
+ bValue = b .executionsDelta .hasData
98
+ ? b .executionsDelta .value
99
+ : - Infinity ;
91
100
// Use percentage as secondary sort for equal delta values
92
- aSecondary = a .executionsDelta .hasData ? Math .abs (a .executionsDelta .percentage ) : 0 ;
93
- bSecondary = b .executionsDelta .hasData ? Math .abs (b .executionsDelta .percentage ) : 0 ;
101
+ aSecondary = a .executionsDelta .hasData
102
+ ? Math .abs (a .executionsDelta .percentage )
103
+ : 0 ;
104
+ bSecondary = b .executionsDelta .hasData
105
+ ? Math .abs (b .executionsDelta .percentage )
106
+ : 0 ;
94
107
break ;
95
108
case " incrementalLoadingDelta" : // Incremental loading delta
96
- aValue = a .incrementalLoadingDelta .hasData ? a .incrementalLoadingDelta .value : - Infinity ;
97
- bValue = b .incrementalLoadingDelta .hasData ? b .incrementalLoadingDelta .value : - Infinity ;
109
+ aValue = a .incrementalLoadingDelta .hasData
110
+ ? a .incrementalLoadingDelta .value
111
+ : - Infinity ;
112
+ bValue = b .incrementalLoadingDelta .hasData
113
+ ? b .incrementalLoadingDelta .value
114
+ : - Infinity ;
98
115
// Use percentage as secondary sort for equal delta values
99
- aSecondary = a .incrementalLoadingDelta .hasData ? Math .abs (a .incrementalLoadingDelta .percentage ) : 0 ;
100
- bSecondary = b .incrementalLoadingDelta .hasData ? Math .abs (b .incrementalLoadingDelta .percentage ) : 0 ;
116
+ aSecondary = a .incrementalLoadingDelta .hasData
117
+ ? Math .abs (a .incrementalLoadingDelta .percentage )
118
+ : 0 ;
119
+ bSecondary = b .incrementalLoadingDelta .hasData
120
+ ? Math .abs (b .incrementalLoadingDelta .percentage )
121
+ : 0 ;
101
122
break ;
102
123
default :
103
124
aValue = a .label ;
@@ -112,7 +133,11 @@ const tableData = computed(() => {
112
133
comparison = (aValue as number ) - (bValue as number );
113
134
114
135
// If primary values are equal and we have secondary sort criteria, use percentage change
115
- if (comparison === 0 && aSecondary !== undefined && bSecondary !== undefined ) {
136
+ if (
137
+ comparison === 0 &&
138
+ aSecondary !== undefined &&
139
+ bSecondary !== undefined
140
+ ) {
116
141
comparison = bSecondary - aSecondary ; // Higher percentage change comes first
117
142
}
118
143
}
@@ -144,9 +169,10 @@ function loadSortFromUrl(urlParams: Dict<string>) {
144
169
145
170
function storeSortToUrl() {
146
171
const params = getUrlParams ();
147
- const sortValue = currentSortDirection .value === " desc"
148
- ? ` -${currentSortColumn .value } `
149
- : currentSortColumn .value ;
172
+ const sortValue =
173
+ currentSortDirection .value === " desc"
174
+ ? ` -${currentSortColumn .value } `
175
+ : currentSortColumn .value ;
150
176
params [" sort" ] = sortValue ;
151
177
changeUrl (params );
152
178
}
@@ -162,7 +188,7 @@ async function loadData() {
162
188
commit ,
163
189
base_commit: base_commit ?? null ,
164
190
benchmark ,
165
- scenario
191
+ scenario ,
166
192
};
167
193
selector .value = currentSelector ;
168
194
@@ -202,7 +228,7 @@ function sortTable(columnName: string, defaultDirection: number) {
202
228
function getSortAttributes(columnName : string ) {
203
229
if (currentSortColumn .value === columnName ) {
204
230
return {
205
- " data-sorted-by" : currentSortDirection .value
231
+ " data-sorted-by" : currentSortDirection .value ,
206
232
};
207
233
}
208
234
return {};
@@ -237,16 +263,16 @@ onMounted(async () => {
237
263
<a :href =" downloadLinksData.baseLinks.crox" >crox</a >,
238
264
<a :href =" downloadLinksData.baseLinks.codegen" >codegen-schedule</a >
239
265
(<a
240
- href =" #"
241
- @click ="
266
+ href =" #"
267
+ @click ="
242
268
handlePerfettoClick(
243
269
$event,
244
270
downloadLinksData.baseLinks.perfetto.link,
245
271
downloadLinksData.baseLinks.perfetto.traceTitle
246
272
)
247
273
"
248
- >Perfetto</a
249
- >,
274
+ >Perfetto</a
275
+ >,
250
276
<a :href =" downloadLinksData.baseLinks.firefox" >Firefox profiler</a >)
251
277
results for {{ selector?.base_commit?.substring(0, 10) }} (base
252
278
commit)
@@ -259,16 +285,16 @@ onMounted(async () => {
259
285
<a :href =" downloadLinksData.newLinks.crox" >crox</a >,
260
286
<a :href =" downloadLinksData.newLinks.codegen" >codegen-schedule</a >
261
287
(<a
262
- href =" #"
263
- @click ="
288
+ href =" #"
289
+ @click ="
264
290
handlePerfettoClick(
265
291
$event,
266
292
downloadLinksData.newLinks.perfetto.link,
267
293
downloadLinksData.newLinks.perfetto.traceTitle
268
294
)
269
295
"
270
- >Perfetto</a
271
- >, <a :href =" downloadLinksData.newLinks.firefox" >Firefox profiler</a >)
296
+ >Perfetto</a
297
+ >, <a :href =" downloadLinksData.newLinks.firefox" >Firefox profiler</a >)
272
298
results for {{ selector?.commit?.substring(0, 10) }} (new commit)
273
299
274
300
<template v-if =" downloadLinksData .diffLink " >
@@ -296,18 +322,18 @@ onMounted(async () => {
296
322
<h4 >Artifact Size</h4 >
297
323
<table id =" artifact-table" >
298
324
<thead >
299
- <tr >
300
- <th >Artifact</th >
301
- <th >Size</th >
302
- <th >Size delta</th >
303
- </tr >
325
+ <tr >
326
+ <th >Artifact</th >
327
+ <th >Size</th >
328
+ <th >Size delta</th >
329
+ </tr >
304
330
</thead >
305
331
<tbody id =" artifact-body" >
306
- <tr v-for =" artifact in artifactData" :key =" artifact.name" >
307
- <td style =" text-align : center " >{{ artifact.name }}</td >
308
- <td >{{ artifact.size }}</td >
309
- <td >{{ artifact.sizeDelta }}</td >
310
- </tr >
332
+ <tr v-for =" artifact in artifactData" :key =" artifact.name" >
333
+ <td style =" text-align : center " >{{ artifact.name }}</td >
334
+ <td >{{ artifact.size }}</td >
335
+ <td >{{ artifact.sizeDelta }}</td >
336
+ </tr >
311
337
</tbody >
312
338
</table >
313
339
@@ -319,91 +345,108 @@ onMounted(async () => {
319
345
320
346
<table :class =" {'hide-incr': !showIncr, 'hide-delta': !showDelta}" >
321
347
<thead >
322
- <tr id =" table-header" >
323
- <th
324
- v-bind =" getSortAttributes('label')"
325
- data-sort-column =" label"
326
- data-default-sort-dir =" 1"
327
- >
328
- <a href =" #" @click.prevent =" sortTable('label', 1)" >Query/Function</a >
329
- </th >
330
- <th
331
- v-bind =" getSortAttributes('timePercent')"
332
- data-sort-column =" timePercent"
333
- data-default-sort-dir =" -1"
334
- >
335
- <a href =" #" @click.prevent =" sortTable('timePercent', -1)" >Time (%)</a >
336
- </th >
337
- <th
338
- v-bind =" getSortAttributes('timeSeconds')"
339
- data-sort-column =" timeSeconds"
340
- data-default-sort-dir =" -1"
341
- >
342
- <a href =" #" @click.prevent =" sortTable('timeSeconds', -1)" >Time (s)</a >
343
- </th >
344
- <th
345
- v-bind =" getSortAttributes('timeDelta')"
346
- class =" delta"
347
- data-sort-column =" timeDelta"
348
- data-default-sort-dir =" -1"
349
- >
350
- <a href =" #" @click.prevent =" sortTable('timeDelta', -1)" >Time delta</a >
351
- </th >
352
- <th
353
- v-bind =" getSortAttributes('executions')"
354
- data-sort-column =" executions"
355
- data-default-sort-dir =" -1"
356
- >
357
- <a href =" #" @click.prevent =" sortTable('executions', -1)" >Executions</a >
358
- </th >
359
- <th
360
- v-bind =" getSortAttributes('executionsDelta')"
361
- class =" delta"
362
- data-sort-column =" executionsDelta"
363
- data-default-sort-dir =" -1"
364
- >
365
- <a href =" #" @click.prevent =" sortTable('executionsDelta', -1)"
366
- >Executions delta</a
348
+ <tr id =" table-header" >
349
+ <th
350
+ v-bind =" getSortAttributes('label')"
351
+ data-sort-column =" label"
352
+ data-default-sort-dir =" 1"
367
353
>
368
- </th >
369
- <th
370
- v-bind =" getSortAttributes('incrementalLoading')"
371
- class =" incr"
372
- data-sort-column =" incrementalLoading"
373
- data-default-sort-dir =" -1"
374
- title =" Incremental loading time"
375
- >
376
- <a href =" #" @click.prevent =" sortTable('incrementalLoading', -1)"
377
- >Incremental loading (s)</a
354
+ <a href =" #" @click.prevent =" sortTable('label', 1)"
355
+ >Query/Function</a
356
+ >
357
+ </th >
358
+ <th
359
+ v-bind =" getSortAttributes('timePercent')"
360
+ data-sort-column =" timePercent"
361
+ data-default-sort-dir =" -1"
378
362
>
379
- </th >
380
- <th
381
- v-bind =" getSortAttributes('incrementalLoadingDelta')"
382
- class =" incr delta"
383
- data-sort-column =" incrementalLoadingDelta"
384
- data-default-sort-dir =" -1"
385
- >
386
- <a href =" #" @click.prevent =" sortTable('incrementalLoadingDelta', -1)"
387
- >Incremental loading delta</a
363
+ <a href =" #" @click.prevent =" sortTable('timePercent', -1)"
364
+ >Time (%)</a
365
+ >
366
+ </th >
367
+ <th
368
+ v-bind =" getSortAttributes('timeSeconds')"
369
+ data-sort-column =" timeSeconds"
370
+ data-default-sort-dir =" -1"
371
+ >
372
+ <a href =" #" @click.prevent =" sortTable('timeSeconds', -1)"
373
+ >Time (s)</a
374
+ >
375
+ </th >
376
+ <th
377
+ v-bind =" getSortAttributes('timeDelta')"
378
+ class =" delta"
379
+ data-sort-column =" timeDelta"
380
+ data-default-sort-dir =" -1"
381
+ >
382
+ <a href =" #" @click.prevent =" sortTable('timeDelta', -1)"
383
+ >Time delta</a
384
+ >
385
+ </th >
386
+ <th
387
+ v-bind =" getSortAttributes('executions')"
388
+ data-sort-column =" executions"
389
+ data-default-sort-dir =" -1"
388
390
>
389
- </th >
390
- </tr >
391
+ <a href =" #" @click.prevent =" sortTable('executions', -1)"
392
+ >Executions</a
393
+ >
394
+ </th >
395
+ <th
396
+ v-bind =" getSortAttributes('executionsDelta')"
397
+ class =" delta"
398
+ data-sort-column =" executionsDelta"
399
+ data-default-sort-dir =" -1"
400
+ >
401
+ <a href =" #" @click.prevent =" sortTable('executionsDelta', -1)"
402
+ >Executions delta</a
403
+ >
404
+ </th >
405
+ <th
406
+ v-bind =" getSortAttributes('incrementalLoading')"
407
+ class =" incr"
408
+ data-sort-column =" incrementalLoading"
409
+ data-default-sort-dir =" -1"
410
+ title =" Incremental loading time"
411
+ >
412
+ <a href =" #" @click.prevent =" sortTable('incrementalLoading', -1)"
413
+ >Incremental loading (s)</a
414
+ >
415
+ </th >
416
+ <th
417
+ v-bind =" getSortAttributes('incrementalLoadingDelta')"
418
+ class =" incr delta"
419
+ data-sort-column =" incrementalLoadingDelta"
420
+ data-default-sort-dir =" -1"
421
+ >
422
+ <a
423
+ href =" #"
424
+ @click.prevent =" sortTable('incrementalLoadingDelta', -1)"
425
+ >Incremental loading delta</a
426
+ >
427
+ </th >
428
+ </tr >
391
429
</thead >
392
430
<tbody id =" primary-table" >
393
- <tr
394
- v-for =" (row, index) in tableData"
395
- :key =" index"
396
- :class =" {'total-row': row.isTotal}"
397
- >
398
- <td >{{ row.label }}</td >
399
- <td :title =" row.timePercent.title" >{{ row.timePercent.formatted }}</td >
400
- <td >{{ row.timeSeconds.toFixed(3) }}</td >
401
- <td class =" delta" v-html =" row.timeDelta.formatted" ></td >
402
- <td >{{ row.executions }}</td >
403
- <td class =" delta" v-html =" row.executionsDelta.formatted" ></td >
404
- <td class =" incr" >{{ row.incrementalLoading.toFixed(3) }}</td >
405
- <td class =" incr delta" v-html =" row.incrementalLoadingDelta.formatted" ></td >
406
- </tr >
431
+ <tr
432
+ v-for =" (row, index) in tableData"
433
+ :key =" index"
434
+ :class =" {'total-row': row.isTotal}"
435
+ >
436
+ <td >{{ row.label }}</td >
437
+ <td :title =" row.timePercent.title" >
438
+ {{ row.timePercent.formatted }}
439
+ </td >
440
+ <td >{{ row.timeSeconds.toFixed(3) }}</td >
441
+ <td class =" delta" v-html =" row.timeDelta.formatted" ></td >
442
+ <td >{{ row.executions }}</td >
443
+ <td class =" delta" v-html =" row.executionsDelta.formatted" ></td >
444
+ <td class =" incr" >{{ row.incrementalLoading.toFixed(3) }}</td >
445
+ <td
446
+ class =" incr delta"
447
+ v-html =" row.incrementalLoadingDelta.formatted"
448
+ ></td >
449
+ </tr >
407
450
</tbody >
408
451
</table >
409
452
</div >
0 commit comments