208
208
text-align : center;
209
209
}
210
210
211
+ # summary {
212
+ border : 1px dashed;
213
+ padding : 4px ;
214
+ border-radius : 6px ;
215
+ }
216
+
211
217
.summary {
212
218
display : flex;
219
+ justify-content : center;
213
220
align-items : center;
221
+ width : 20% ;
214
222
}
215
223
</ style >
216
224
< script src ="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js "> </ script >
@@ -322,7 +330,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
322
330
</ li >
323
331
< li >
324
332
< label >
325
- < input type ="checkbox " id ="build-incremental-unchanged " v-model ="filter.cache.incrUnchanged " />
333
+ < input type ="checkbox " id ="build-incremental-unchanged "
334
+ v-model ="filter.cache.incrUnchanged " />
326
335
< span class ="cache-label "> incr-unchanged</ span >
327
336
</ label >
328
337
< div class ="tooltip "> ?
@@ -334,7 +343,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
334
343
</ li >
335
344
< li >
336
345
< label >
337
- < input type ="checkbox " id ="build-incremental-patched " v-model ="filter.cache.incrPatched " />
346
+ < input type ="checkbox " id ="build-incremental-patched "
347
+ v-model ="filter.cache.incrPatched " />
338
348
< span class ="cache-label "> incr-patched</ span >
339
349
</ label >
340
350
< div class ="tooltip "> ?
@@ -352,7 +362,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
352
362
< span class ="tooltip "> ?
353
363
< span class ="tooltiptext ">
354
364
Whether to filter out all benchmarks that do not show significant changes. A significant
355
- change is any change above 0.2% for non-noisy benchmarks and 1.0% for noisy ones.
365
+ change is any change greater than or equal to 0.2% for non-noisy benchmarks and above
366
+ 1.0% for noisy ones.
356
367
</ span >
357
368
</ span >
358
369
</ div >
@@ -361,30 +372,35 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
361
372
</ div >
362
373
</ fieldset >
363
374
< div v-if ="data " id ="content " style ="margin-top: 15px ">
364
- < div style ="display: flex; justify-content: space-evenly; ">
365
- < span style ="font-weight: bold; "> Summary:</ span >
366
- < span class ="summary positive ">
367
- {{summary.numRegressed}}
368
- < svg style ="width:18px;height:18px " viewBox ="0 0 24 24 ">
369
- < path
370
- d ="M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z ">
371
- </ path >
372
- </ svg >
373
- </ span >
374
- < span class ="summary ">
375
- {{summary.numUnchanged}}
376
- < svg style ="width:18px;height:18px " viewBox ="0 0 24 24 ">
377
- < path d ="M22,12L18,8V11H3V13H18V16L22,12Z "> </ path >
378
- </ svg >
379
- </ span >
380
- < span class ="summary negative ">
381
- {{summary.numImproved}}
382
- < svg style ="width:18px;height:18px " viewBox ="0 0 24 24 ">
383
- < path
384
- d ="M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z ">
385
- </ path >
386
- </ svg >
387
- </ span >
375
+ < div id ="summary ">
376
+ < div v-for ="summaryPair in Object.entries(summary) " style ="display: flex; ">
377
+ < span style ="font-weight: bold; width: 30%; margin-left: 15%; text-transform: capitalize; "> {{
378
+ summaryPair[0] }}:</ span >
379
+ < div style ="display: flex; justify-content: flex-end; width: 80%; margin-right: 15%; ">
380
+ < span class ="summary positive ">
381
+ {{summaryPair[1].regressions.toString().padStart(3, " ")}}
382
+ < svg style ="width:18px;height:18px " viewBox ="0 0 24 24 ">
383
+ < path
384
+ d ="M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z ">
385
+ </ path >
386
+ </ svg >
387
+ </ span >
388
+ < span class ="summary ">
389
+ {{summaryPair[1].unchanged.toString().padStart(3, " ")}}
390
+ < svg style ="width:18px;height:18px " viewBox ="0 0 24 24 ">
391
+ < path d ="M22,12L18,8V11H3V13H18V16L22,12Z "> </ path >
392
+ </ svg >
393
+ </ span >
394
+ < span class ="summary negative ">
395
+ {{summaryPair[1].improvements.toString().padStart(3, " ")}}
396
+ < svg style ="width:18px;height:18px " viewBox ="0 0 24 24 ">
397
+ < path
398
+ d ="M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z ">
399
+ </ path >
400
+ </ svg >
401
+ </ span >
402
+ </ div >
403
+ </ div >
388
404
</ div >
389
405
< table id ="benches " class ="compare ">
390
406
< template v-for ="bench in benches ">
@@ -407,7 +423,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
407
423
< a
408
424
v-bind:href ="percentLink(data.b.commit, data.a.commit, bench.name, run.casename) ">
409
425
< span v-bind:class ="percentClass(run.percent) ">
410
- {{ run.percent }}%{{run.isDodgy ? "?" : ""}}
426
+ {{ run.percent.toFixed(2) }}%{{run.isDodgy ? "?" : ""}}
411
427
</ span >
412
428
</ a >
413
429
</ td >
@@ -520,11 +536,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
520
536
if ( ! datumB ) {
521
537
continue ;
522
538
}
523
- let percent = ( 100 * ( datumB - datumA ) / datumA ) . toFixed ( 1 ) ;
524
- if ( percent === "-0.0" ) {
525
- percent = "0.0" ;
526
- }
527
-
539
+ let percent = ( 100 * ( datumB - datumA ) / datumA ) ;
528
540
let isDodgy = false ;
529
541
if ( data . variance ) {
530
542
let variance = data . variance [ name + "-" + key ] ;
@@ -548,11 +560,10 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
548
560
Object . keys ( data . a . data ) .
549
561
filter ( n => filter . name && filter . name . trim ( ) ? n . includes ( filter . name . trim ( ) ) : true ) .
550
562
map ( name => {
551
- const variants = toVariants ( name ) . filter ( v => filter . showOnlySignificant ? isSignificant ( v ) : true ) ;
563
+ const variants = toVariants ( name ) . filter ( v => filter . showOnlySignificant ? isSignificant ( v . percent , v . isDodgy ) : true ) ;
552
564
const pcts = variants . map ( field => parseFloat ( field . percent ) ) ;
553
565
const maxPct = Math . max ( ...pcts ) . toFixed ( 1 ) ;
554
566
const minPct = Math . min ( ...pcts ) . toFixed ( 1 ) ;
555
- const maxCasenameLen = Math . max ( ...variants . map ( f => f . casename . length ) ) ;
556
567
if ( variants . length > 0 ) {
557
568
variants [ 0 ] . first = true ;
558
569
}
@@ -562,7 +573,6 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
562
573
variants,
563
574
maxPct,
564
575
minPct,
565
- maxCasenameLen,
566
576
} ;
567
577
} ) .
568
578
filter ( b => b . variants . length > 0 ) ;
@@ -626,34 +636,32 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
626
636
return findQueryParam ( "stat" ) || "instructions:u" ;
627
637
} ,
628
638
summary ( ) {
629
- let numRegressed = 0 ;
630
- let numImproved = 0 ;
631
- let numUnchanged = 0 ;
632
- for ( let name of Object . keys ( this . data . a . data ) ) {
633
- for ( let d of this . data . a . data [ name ] ) {
634
- const run = d [ 0 ] ;
639
+ const filtered = Object . fromEntries ( this . benches . map ( b => [ b . name , Object . fromEntries ( b . variants . map ( v => [ v . casename , true ] ) ) ] ) ) ;
640
+ const newCount = { regressions : 0 , improvements : 0 , unchanged : 0 }
641
+ let result = { all : { ... newCount } , filtered : { ... newCount } }
642
+ for ( let benchmarkAndProfile of Object . keys ( this . data . a . data ) ) {
643
+ for ( let d of this . data . a . data [ benchmarkAndProfile ] ) {
644
+ const scenario = d [ 0 ] ;
635
645
const datumA = d [ 1 ] ;
636
- const datumB = this . data . b . data [ name ] ?. find ( x => x [ 0 ] == run ) ?. [ 1 ] ;
646
+ const datumB = this . data . b . data [ benchmarkAndProfile ] ?. find ( x => x [ 0 ] == scenario ) ?. [ 1 ] ;
637
647
if ( ! datumB ) {
638
648
continue ;
639
649
}
640
650
let percent = 100 * ( ( datumB - datumA ) / datumA ) ;
641
- const isDodgy = this . isDodgy ( name , run ) ;
642
- const threshold = isDodgy ? 1.0 : 0.2 ;
643
- if ( percent > threshold ) {
644
- numRegressed += 1 ;
645
- } else if ( percent < - threshold ) {
646
- numImproved += 1 ;
651
+ const isDodgy = this . isDodgy ( benchmarkAndProfile , scenario ) ;
652
+ if ( percent > 0 && isSignificant ( percent , isDodgy ) ) {
653
+ result . all . regressions += 1 ;
654
+ result . filtered . regressions += filtered [ benchmarkAndProfile ] ?. [ scenario ] || 0 ;
655
+ } else if ( percent < 0 && isSignificant ( percent , isDodgy ) ) {
656
+ result . all . improvements += 1 ;
657
+ result . filtered . improvements += filtered [ benchmarkAndProfile ] ?. [ scenario ] || 0 ;
647
658
} else {
648
- numUnchanged += 1
659
+ result . all . unchanged += 1 ;
660
+ result . filtered . unchanged += filtered [ benchmarkAndProfile ] ?. [ scenario ] || 0 ;
649
661
}
650
662
}
651
663
}
652
- return {
653
- numRegressed,
654
- numImproved,
655
- numUnchanged,
656
- }
664
+ return result ;
657
665
658
666
}
659
667
} ,
@@ -668,11 +676,11 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
668
676
let klass = "" ;
669
677
if ( pct > 1 ) {
670
678
klass = 'positive' ;
671
- } else if ( pct > 0.1 ) {
679
+ } else if ( pct >= 0.2 ) {
672
680
klass = 'slightly-positive' ;
673
681
} else if ( pct < - 1 ) {
674
682
klass = 'negative' ;
675
- } else if ( pct < - 0.1 ) {
683
+ } else if ( pct <= - 0.2 ) {
676
684
klass = 'slightly-negative' ;
677
685
}
678
686
return klass ;
@@ -713,25 +721,24 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
713
721
}
714
722
return result ;
715
723
} ,
716
- isDodgy ( name , run ) {
724
+ isDodgy ( benchmarkAndProfile , scenario ) {
717
725
let variance = this . data . variance ;
718
726
if ( ! variance ) {
719
727
return false ;
720
728
}
721
- variance = this . data . variance [ name + "-" + run ] ;
729
+ variance = this . data . variance [ benchmarkAndProfile + "-" + scenario ] ;
722
730
return ( variance ?. description ?. type ?? "Normal" ) != "Normal" ;
723
- }
731
+ } ,
724
732
} ,
725
733
} ) ;
726
734
727
- function isSignificant ( variant ) {
728
- const percent = Math . abs ( variant . percent ) ;
729
- if ( variant . isDodgy ) {
730
- return percent > 1.0 ;
735
+ function isSignificant ( percent , isNoisy ) {
736
+ const perAbs = Math . abs ( percent ) ;
737
+ if ( isNoisy ) {
738
+ return perAbs > 1.0 ;
731
739
} else {
732
- return percent > 0.2 ;
740
+ return perAbs >= 0.2 ;
733
741
}
734
-
735
742
}
736
743
737
744
function toggleFilters ( id , toggle ) {
@@ -790,4 +797,4 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
790
797
</ script >
791
798
</ body >
792
799
793
- </ html >
800
+ </ html >
0 commit comments