@@ -423,10 +423,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
423
423
< table id ="benches " class ="compare ">
424
424
< tbody >
425
425
< tr >
426
- < th > Name & Profile</ th >
426
+ < th > Benchmark & Profile</ th >
427
427
< th > Scenario</ th >
428
- < th > {{before}}</ th >
429
- < th > {{after}}</ th >
430
428
< th > % Change</ th >
431
429
< th >
432
430
Significance Factor< span class ="tooltip "> ?
@@ -439,40 +437,39 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
439
437
</ span >
440
438
</ span >
441
439
</ th >
440
+ < th > {{before}}</ th >
441
+ < th > {{after}}</ th >
442
442
</ tr >
443
443
</ tbody >
444
- < template v-for ="bench in benches ">
445
- < tbody >
446
- < template v-for ="testCase in bench.testCases ">
447
- < tr >
448
- < th v-if ="testCase.first " v-bind:rowspan ="bench.testCases.length "> {{bench.name}}</ th >
449
- < td > {{ testCase.scenario }}</ td >
450
- < td >
451
- < a v-bind:href ="detailedQueryLink(data.a.commit, bench.name, testCase.scenario) ">
452
- {{ testCase.datumA }}
453
- </ a >
454
- </ td >
455
- < td >
456
- < a v-bind:href ="detailedQueryLink(data.b.commit, bench.name, testCase.scenario) ">
457
- {{ testCase.datumB }}
458
- </ a >
459
- </ td >
460
- < td >
461
- < a
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 ? "?" : ""}}
465
- </ span >
466
- </ a >
467
- </ td >
468
- < td >
469
- {{ testCase.significanceFactor ? testCase.significanceFactor.toFixed(2) + "x" :"-"
470
- }}
471
- </ td >
472
- </ tr >
473
- </ template >
474
- </ tbody >
475
- </ template >
444
+ < tbody >
445
+ < template v-for ="testCase in testCases ">
446
+ < tr >
447
+ < td > {{ testCase.benchmark }} {{ testCase.profile }}</ td >
448
+ < td > {{ testCase.scenario }}</ td >
449
+ < td >
450
+ < a v-bind:href ="percentLink(data.b.commit, data.a.commit, testCase) ">
451
+ < span v-bind:class ="percentClass(testCase.percent) ">
452
+ {{ testCase.percent.toFixed(2) }}%{{testCase.isDodgy ? "?" : ""}}
453
+ </ span >
454
+ </ a >
455
+ </ td >
456
+ < td >
457
+ {{ testCase.significanceFactor ? testCase.significanceFactor.toFixed(2) + "x" :"-"
458
+ }}
459
+ </ td >
460
+ < td >
461
+ < a v-bind:href ="detailedQueryLink(data.a.commit, testCase) ">
462
+ {{ testCase.datumA }}
463
+ </ a >
464
+ </ td >
465
+ < td >
466
+ < a v-bind:href ="detailedQueryLink(data.b.commit, testCase) ">
467
+ {{ testCase.datumB }}
468
+ </ a >
469
+ </ td >
470
+ </ tr >
471
+ </ template >
472
+ </ tbody >
476
473
</ table >
477
474
< br />
478
475
< table id ="bootstrap " class ="compare " style ="margin: auto; "
@@ -552,7 +549,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
552
549
compareLink ( ) {
553
550
return `https://github.com/rust-lang/rust/compare/${ this . data . a . commit } ...${ this . data . b . commit } ` ;
554
551
} ,
555
- benches ( ) {
552
+ testCases ( ) {
556
553
let data = this . data ;
557
554
const filter = this . filter ;
558
555
@@ -571,7 +568,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
571
568
}
572
569
}
573
570
574
- function shouldShowTestCase ( name , testCase ) {
571
+ function shouldShowTestCase ( testCase ) {
572
+ const name = `${ testCase . benchmark } ${ testCase . profile } ${ testCase . scenario } ` ;
575
573
let nameFilter = filter . name && filter . name . trim ( ) ;
576
574
nameFilter = ! nameFilter || name . includes ( nameFilter ) ;
577
575
@@ -582,67 +580,34 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
582
580
return scenarioFilter ( testCase . scenario ) && significanceFilter && nameFilter && magnitudeFilter ;
583
581
}
584
582
585
- function toTestCases ( name , results ) {
586
- return results . map ( r => {
587
- const scenario = r . scenario ;
588
- const datumA = r . statistics [ 0 ] ;
589
- const datumB = r . statistics [ 1 ] ;
590
- const isSignificant = r . is_significant ;
591
- const significanceFactor = r . significance_factor ;
592
- const isDodgy = r . is_dodgy ;
593
- let percent = 100 * ( ( datumB - datumA ) / datumA ) ;
594
- return {
595
- scenario,
596
- datumA,
597
- datumB,
598
- isSignificant,
599
- magnitude : r . magnitude ,
600
- significanceFactor,
601
- isDodgy,
602
- percent,
603
- } ;
604
- } ) . filter ( tc => shouldShowTestCase ( name , tc ) )
605
- }
583
+ let testCases =
584
+ data . comparisons
585
+ . map ( c => {
586
+ const datumA = c . statistics [ 0 ] ;
587
+ const datumB = c . statistics [ 1 ] ;
588
+ const percent = 100 * ( ( datumB - datumA ) / datumA ) ;
589
+ return {
590
+ benchmark : c . benchmark ,
591
+ profile : c . profile ,
592
+ scenario : c . scenario ,
593
+ magnitude : c . magnitude ,
594
+ isSignificant : c . is_significant ,
595
+ significanceFactor : c . significance_factor ,
596
+ isDodgy : c . is_dodgy ,
597
+ datumA,
598
+ datumB,
599
+ percent,
600
+ } ;
601
+ } )
602
+ . filter ( tc => shouldShowTestCase ( tc ) )
606
603
607
- let benches =
608
- data . comparisons .
609
- reduce ( ( accum , next ) => {
610
- const key = next . benchmark + "-" + next . profile ;
611
- if ( ! accum [ key ] ) {
612
- accum [ key ] = [ ] ;
613
- }
614
- accum [ key ] . push ( next ) ;
615
- return accum ;
616
- } , { } ) ;
617
- benches = Object . entries ( benches ) .
618
- map ( c => {
619
- const name = c [ 0 ] ;
620
- const comparison = c [ 1 ] ;
621
- const testCases = toTestCases ( name , comparison ) ;
622
- const pcts = testCases . map ( tc => parseFloat ( tc . percent ) ) ;
623
- const maxPct = Math . max ( ...pcts ) . toFixed ( 1 ) ;
624
- const minPct = Math . min ( ...pcts ) . toFixed ( 1 ) ;
625
- if ( testCases . length > 0 ) {
626
- testCases [ 0 ] . first = true ;
627
- }
628
-
629
- return {
630
- name,
631
- testCases,
632
- maxPct,
633
- minPct,
634
- } ;
635
- } ) .
636
- filter ( b => b . testCases . length > 0 ) ;
637
-
638
- const largestChange = a => Math . max ( Math . abs ( a . minPct ) , Math . abs ( a . maxPct ) ) ;
639
604
// Sort by name first, so that there is a canonical ordering
640
- // of benches . This ensures the overall order is stable, even if
605
+ // of test cases . This ensures the overall order is stable, even if
641
606
// individual benchmarks have the same largestChange value.
642
- benches . sort ( ( a , b ) => a . name . localeCompare ( b . name ) ) ;
643
- benches . sort ( ( a , b ) => largestChange ( b ) - largestChange ( a ) ) ;
607
+ testCases . sort ( ( a , b ) => a . benchmark . localeCompare ( b . benchmark ) ) ;
608
+ testCases . sort ( ( a , b ) => Math . abs ( b . percent ) - Math . abs ( a . percent ) ) ;
644
609
645
- return benches ;
610
+ return testCases ;
646
611
} ,
647
612
bootstrapTotals ( ) {
648
613
const sum = bootstrap => Object . entries ( bootstrap ) . map ( e => e [ 1 ] / 1e9 ) . reduce ( ( sum , next ) => sum + next , 0 ) ;
@@ -699,7 +664,10 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
699
664
} ,
700
665
summary ( ) {
701
666
// Create object with each test case that is not filtered out as a key
702
- const filtered = Object . fromEntries ( this . benches . flatMap ( b => b . testCases . map ( v => [ b . name + "-" + v . scenario , true ] ) ) ) ;
667
+ const filtered = this . testCases . reduce ( ( sum , next ) => {
668
+ sum [ testCaseString ( next ) ] = true ;
669
+ return sum ;
670
+ } , { } ) ;
703
671
const newCount = { regressions : 0 , improvements : 0 , unchanged : 0 }
704
672
let result = { all : { ...newCount } , filtered : { ...newCount } }
705
673
for ( let d of this . data . comparisons ) {
@@ -734,15 +702,14 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
734
702
let klass = "" ;
735
703
if ( pct > 1 ) {
736
704
klass = 'positive' ;
737
- } else if ( pct >= 0.2 ) {
705
+ } else if ( pct > 0 ) {
738
706
klass = 'slightly-positive' ;
739
707
} else if ( pct < - 1 ) {
740
708
klass = 'negative' ;
741
- } else if ( pct <= - 0.2 ) {
709
+ } else if ( pct < - 0 ) {
742
710
klass = 'slightly-negative' ;
743
711
}
744
712
return klass ;
745
-
746
713
} ,
747
714
diffClass ( diff ) {
748
715
let klass = "" ;
@@ -754,11 +721,11 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
754
721
return klass ;
755
722
756
723
} ,
757
- detailedQueryLink ( commit , bench , testCase ) {
758
- return `/detailed-query.html?commit=${ commit } &benchmark=${ bench } &run_name=${ testCase } ` ;
724
+ detailedQueryLink ( commit , testCase ) {
725
+ return `/detailed-query.html?commit=${ commit } &benchmark=${ testCase . benchmark + "-" + testCase . profile } &run_name=${ testCase . scenario } ` ;
759
726
} ,
760
- percentLink ( commit , baseCommit , bench , testCase ) {
761
- return `/detailed-query.html?commit=${ commit } &base_commit=${ baseCommit } &benchmark=${ bench } &run_name=${ testCase } ` ;
727
+ percentLink ( commit , baseCommit , testCase ) {
728
+ return `/detailed-query.html?commit=${ commit } &base_commit=${ baseCommit } &benchmark=${ testCase . benchmark + "-" + testCase . profile } &run_name=${ testCase . scenario } ` ;
762
729
} ,
763
730
commitLink ( commit ) {
764
731
return `https://github.com/rust-lang/rust/commit/${ commit } ` ;
@@ -847,4 +814,4 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
847
814
</ script >
848
815
</ body >
849
816
850
- </ html >
817
+ </ html >
0 commit comments