@@ -313,7 +313,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
313
313
< ul id ="states-list ">
314
314
< li >
315
315
< label >
316
- < input type ="checkbox " id ="build-full " v-model ="filter.cache .full " />
316
+ < input type ="checkbox " id ="build-full " v-model ="filter.scenario .full " />
317
317
< span class ="cache-label "> full</ span >
318
318
</ label >
319
319
< div class ="tooltip "> ?
@@ -324,7 +324,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
324
324
</ li >
325
325
< li >
326
326
< label >
327
- < input type ="checkbox " id ="build-incremental-full " v-model ="filter.cache .incrFull " />
327
+ < input type ="checkbox " id ="build-incremental-full " v-model ="filter.scenario .incrFull " />
328
328
< span class ="cache-label "> incr-full</ span >
329
329
</ label >
330
330
< div class ="tooltip "> ?
@@ -336,7 +336,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
336
336
< li >
337
337
< label >
338
338
< input type ="checkbox " id ="build-incremental-unchanged "
339
- v-model ="filter.cache .incrUnchanged " />
339
+ v-model ="filter.scenario .incrUnchanged " />
340
340
< span class ="cache-label "> incr-unchanged</ span >
341
341
</ label >
342
342
< div class ="tooltip "> ?
@@ -349,7 +349,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
349
349
< li >
350
350
< label >
351
351
< input type ="checkbox " id ="build-incremental-patched "
352
- v-model ="filter.cache .incrPatched " />
352
+ v-model ="filter.scenario .incrPatched " />
353
353
< span class ="cache-label "> incr-patched</ span >
354
354
</ label >
355
355
< div class ="tooltip "> ?
@@ -374,6 +374,19 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
374
374
</ div >
375
375
< input type ="checkbox " v-model ="filter.showOnlySignificant " style ="margin-left: 20px; " />
376
376
</ div >
377
+ < div class ="section ">
378
+ < div class ="section-heading "> < span > Filter out very small changes</ span >
379
+ < span class ="tooltip "> ?
380
+ < span class ="tooltiptext ">
381
+ Whether to filter out test cases that have a very small magnitude. Magnitude is
382
+ calculated both on the absolute magnitude (i.e., how large of a percentage change)
383
+ as well as the magnitude of the significance (i.e., by how many time the change was
384
+ over the significance threshold).
385
+ </ span >
386
+ </ span >
387
+ </ div >
388
+ < input type ="checkbox " v-model ="filter.filterVerySmall " style ="margin-left: 20px; " />
389
+ </ div >
377
390
</ div >
378
391
</ fieldset >
379
392
< div v-if ="data " id ="content " style ="margin-top: 15px ">
@@ -430,30 +443,31 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
430
443
</ tbody >
431
444
< template v-for ="bench in benches ">
432
445
< tbody >
433
- < template v-for ="run in bench.variants ">
446
+ < template v-for ="testCase in bench.testCases ">
434
447
< tr >
435
- < th v-if ="run .first " v-bind:rowspan ="bench.variants .length "> {{bench.name}}</ th >
436
- < td > {{ run.casename }}</ td >
448
+ < th v-if ="testCase .first " v-bind:rowspan ="bench.testCases .length "> {{bench.name}}</ th >
449
+ < td > {{ testCase.scenario }}</ td >
437
450
< td >
438
- < a v-bind:href ="detailedQueryLink(data.a.commit, bench.name, run.casename ) ">
439
- {{ run .datumA }}
451
+ < a v-bind:href ="detailedQueryLink(data.a.commit, bench.name, testCase.scenario ) ">
452
+ {{ testCase .datumA }}
440
453
</ a >
441
454
</ td >
442
455
< td >
443
- < a v-bind:href ="detailedQueryLink(data.b.commit, bench.name, run.casename ) ">
444
- {{ run .datumB }}
456
+ < a v-bind:href ="detailedQueryLink(data.b.commit, bench.name, testCase.scenario ) ">
457
+ {{ testCase .datumB }}
445
458
</ a >
446
459
</ td >
447
460
< td >
448
461
< a
449
- v-bind:href ="percentLink(data.b.commit, data.a.commit, bench.name, run.casename ) ">
450
- < span v-bind:class ="percentClass(run .percent) ">
451
- {{ run .percent.toFixed(2) }}%{{run .isDodgy ? "?" : ""}}
462
+ v-bind:href ="percentLink(data.b.commit, data.a.commit, bench.name, testCase.scenario ) ">
463
+ < span v-bind:class ="percentClass(testCase .percent) ">
464
+ {{ testCase .percent.toFixed(2) }}%{{testCase .isDodgy ? "?" : ""}}
452
465
</ span >
453
466
</ a >
454
467
</ td >
455
468
< td >
456
- {{ run.significance_factor ? run.significance_factor.toFixed(2) + "x" :"-" }}
469
+ {{ testCase.significanceFactor ? testCase.significanceFactor.toFixed(2) + "x" :"-"
470
+ }}
457
471
</ td >
458
472
</ tr >
459
473
</ template >
@@ -515,7 +529,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
515
529
filter : {
516
530
name : null ,
517
531
showOnlySignificant : true ,
518
- cache : {
532
+ filterVerySmall : true ,
533
+ scenario : {
519
534
full : true ,
520
535
incrFull : true ,
521
536
incrUnchanged : true ,
@@ -541,51 +556,62 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
541
556
let data = this . data ;
542
557
const filter = this . filter ;
543
558
544
- function shouldShowBuild ( name ) {
545
- if ( name === "full" ) {
546
- return filter . cache . full ;
547
- } else if ( name === "incr-full" ) {
548
- return filter . cache . incrFull ;
549
- } else if ( name === "incr-unchanged" ) {
550
- return filter . cache . incrUnchanged ;
551
- } else if ( name . startsWith ( "incr-patched" ) ) {
552
- return filter . cache . incrPatched ;
559
+ function scenarioFilter ( scenario ) {
560
+ if ( scenario === "full" ) {
561
+ return filter . scenario . full ;
562
+ } else if ( scenario === "incr-full" ) {
563
+ return filter . scenario . incrFull ;
564
+ } else if ( scenario === "incr-unchanged" ) {
565
+ return filter . scenario . incrUnchanged ;
566
+ } else if ( scenario . startsWith ( "incr-patched" ) ) {
567
+ return filter . scenario . incrPatched ;
553
568
} else {
554
569
// Unknown, but by default we should show things
555
570
return true ;
556
571
}
557
572
}
558
- function toVariants ( results ) {
559
- let variants = [ ] ;
573
+
574
+ function shouldShowTestCase ( testCase ) {
575
+ let nameFilter = filter . name && filter . name . trim ( ) ;
576
+ nameFilter = ! nameFilter || ( testCase . benchmark + "-" + testCase . profile ) . includes ( nameFilter ) ;
577
+
578
+ const significanceFilter = filter . showOnlySignificant ? testCase . isSignificant : true ;
579
+
580
+ const magnitudeFilter = filter . filterVerySmall ? testCase . magnitude != "very small" : true ;
581
+
582
+ return scenarioFilter ( testCase . scenario ) && significanceFilter && nameFilter && magnitudeFilter ;
583
+ }
584
+
585
+ function toTestCases ( results ) {
586
+ let testCases = [ ] ;
560
587
for ( let r of results ) {
561
- const scenarioName = r . scenario ;
588
+ const scenario = r . scenario ;
562
589
const datumA = r . statistics [ 0 ] ;
563
590
const datumB = r . statistics [ 1 ] ;
564
591
const isSignificant = r . is_significant ;
565
- let percent = ( 100 * ( datumB - datumA ) / datumA ) ;
566
- let isDodgy = r . is_dodgy ;
567
- if ( shouldShowBuild ( scenarioName ) ) {
568
- variants . push ( {
569
- casename : scenarioName ,
570
- datumA,
571
- datumB,
572
- percent,
573
- isDodgy,
574
- significance_factor : r . significance_factor ,
575
- isSignificant
576
- } ) ;
592
+ const significanceFactor = r . significance_factor ;
593
+ const isDodgy = r . is_dodgy ;
594
+ let percent = 100 * ( ( datumB - datumA ) / datumA ) ;
595
+ let testCase = {
596
+ scenario,
597
+ datumA,
598
+ datumB,
599
+ isSignificant,
600
+ magnitude : r . magnitude ,
601
+ significanceFactor,
602
+ isDodgy,
603
+ percent,
604
+ } ;
605
+ if ( shouldShowTestCase ( testCase ) ) {
606
+ testCases . push ( testCase ) ;
577
607
}
578
608
}
579
609
580
- return variants ;
610
+ return testCases ;
581
611
}
582
612
583
613
let benches =
584
614
data . comparisons .
585
- filter ( n => {
586
- const f = filter . name && filter . name . trim ( ) ;
587
- return ! f || ( n . benchmark + "-" + n . profile ) . includes ( f ) ;
588
- } ) .
589
615
reduce ( ( accum , next ) => {
590
616
const key = next . benchmark + "-" + next . profile ;
591
617
if ( ! accum [ key ] ) {
@@ -598,22 +624,22 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
598
624
map ( c => {
599
625
const name = c [ 0 ] ;
600
626
const comparison = c [ 1 ] ;
601
- const variants = toVariants ( comparison ) . filter ( v => filter . showOnlySignificant ? v . isSignificant : true ) ;
602
- const pcts = variants . map ( field => parseFloat ( field . percent ) ) ;
627
+ const testCases = toTestCases ( comparison ) ;
628
+ const pcts = testCases . map ( tc => parseFloat ( tc . percent ) ) ;
603
629
const maxPct = Math . max ( ...pcts ) . toFixed ( 1 ) ;
604
630
const minPct = Math . min ( ...pcts ) . toFixed ( 1 ) ;
605
- if ( variants . length > 0 ) {
606
- variants [ 0 ] . first = true ;
631
+ if ( testCases . length > 0 ) {
632
+ testCases [ 0 ] . first = true ;
607
633
}
608
634
609
635
return {
610
636
name,
611
- variants ,
637
+ testCases ,
612
638
maxPct,
613
639
minPct,
614
640
} ;
615
641
} ) .
616
- filter ( b => b . variants . length > 0 ) ;
642
+ filter ( b => b . testCases . length > 0 ) ;
617
643
618
644
const largestChange = a => Math . max ( Math . abs ( a . minPct ) , Math . abs ( a . maxPct ) ) ;
619
645
// Sort by name first, so that there is a canonical ordering
@@ -679,7 +705,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
679
705
} ,
680
706
summary ( ) {
681
707
// Create object with each test case that is not filtered out as a key
682
- const filtered = Object . fromEntries ( this . benches . flatMap ( b => b . variants . map ( v => [ b . name + "-" + v . casename , true ] ) ) ) ;
708
+ const filtered = Object . fromEntries ( this . benches . flatMap ( b => b . testCases . map ( v => [ b . name + "-" + v . scenario , true ] ) ) ) ;
683
709
const newCount = { regressions : 0 , improvements : 0 , unchanged : 0 }
684
710
let result = { all : { ...newCount } , filtered : { ...newCount } }
685
711
for ( let d of this . data . comparisons ) {
@@ -734,11 +760,11 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
734
760
return klass ;
735
761
736
762
} ,
737
- detailedQueryLink ( commit , bench , run ) {
738
- return `/detailed-query.html?commit=${ commit } &benchmark=${ bench } &run_name=${ run } ` ;
763
+ detailedQueryLink ( commit , bench , testCase ) {
764
+ return `/detailed-query.html?commit=${ commit } &benchmark=${ bench } &run_name=${ testCase } ` ;
739
765
} ,
740
- percentLink ( commit , baseCommit , bench , run ) {
741
- return `/detailed-query.html?commit=${ commit } &base_commit=${ baseCommit } &benchmark=${ bench } &run_name=${ run } ` ;
766
+ percentLink ( commit , baseCommit , bench , testCase ) {
767
+ return `/detailed-query.html?commit=${ commit } &base_commit=${ baseCommit } &benchmark=${ bench } &run_name=${ testCase } ` ;
742
768
} ,
743
769
commitLink ( commit ) {
744
770
return `https://github.com/rust-lang/rust/commit/${ commit } ` ;
@@ -823,4 +849,4 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
823
849
</ script >
824
850
</ body >
825
851
826
- </ html >
852
+ </ html >
0 commit comments