@@ -423,10 +423,7 @@ <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 >
427
- < th > Scenario</ th >
428
- < th > {{before}}</ th >
429
- < th > {{after}}</ th >
426
+ < th > Benchmark Profile Scenario</ th >
430
427
< th > % Change</ th >
431
428
< th >
432
429
Significance Factor< span class ="tooltip "> ?
@@ -439,40 +436,36 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
439
436
</ span >
440
437
</ span >
441
438
</ th >
439
+ < th > {{before}} <=> {{after}}</ th >
442
440
</ tr >
443
441
</ 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 >
442
+ < tbody >
443
+ < template v-for ="testCase in testCases ">
444
+ < tr >
445
+ < td > {{ testCase.benchmark }} {{ testCase.profile }} < br /> {{ testCase.scenario }}</ td >
446
+ < td >
447
+ < a v-bind:href ="percentLink(data.b.commit, data.a.commit, testCase) ">
448
+ < span v-bind:class ="percentClass(testCase.percent) ">
449
+ {{ testCase.percent.toFixed(2) }}%{{testCase.isDodgy ? "?" : ""}}
450
+ </ span >
451
+ </ a >
452
+ </ td >
453
+ < td >
454
+ {{ testCase.significanceFactor ? testCase.significanceFactor.toFixed(2) + "x" :"-"
455
+ }}
456
+ </ td >
457
+ < td >
458
+ < a v-bind:href ="detailedQueryLink(data.a.commit, testCase) ">
459
+ {{ testCase.datumA }}
460
+ </ a >
461
+ <=>
462
+ < a v-bind:href ="detailedQueryLink(data.b.commit, testCase) ">
463
+ {{ testCase.datumB }}
464
+ </ a >
465
+ </ td >
466
+ </ tr >
467
+ </ template >
468
+ </ tbody >
476
469
</ table >
477
470
< br />
478
471
< table id ="bootstrap " class ="compare " style ="margin: auto; "
@@ -552,7 +545,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
552
545
compareLink ( ) {
553
546
return `https://github.com/rust-lang/rust/compare/${ this . data . a . commit } ...${ this . data . b . commit } ` ;
554
547
} ,
555
- benches ( ) {
548
+ testCases ( ) {
556
549
let data = this . data ;
557
550
const filter = this . filter ;
558
551
@@ -571,7 +564,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
571
564
}
572
565
}
573
566
574
- function shouldShowTestCase ( name , testCase ) {
567
+ function shouldShowTestCase ( testCase ) {
568
+ const name = `${ testCase . benchmark } ${ testCase . profile } ${ testCase . scenario } ` ;
575
569
let nameFilter = filter . name && filter . name . trim ( ) ;
576
570
nameFilter = ! nameFilter || name . includes ( nameFilter ) ;
577
571
@@ -582,67 +576,34 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
582
576
return scenarioFilter ( testCase . scenario ) && significanceFilter && nameFilter && magnitudeFilter ;
583
577
}
584
578
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
- }
579
+ let testCases =
580
+ data . comparisons
581
+ . map ( c => {
582
+ const datumA = c . statistics [ 0 ] ;
583
+ const datumB = c . statistics [ 1 ] ;
584
+ const percent = 100 * ( ( datumB - datumA ) / datumA ) ;
585
+ return {
586
+ benchmark : c . benchmark ,
587
+ profile : c . profile ,
588
+ scenario : c . scenario ,
589
+ magnitude : c . magnitude ,
590
+ isSignificant : c . is_significant ,
591
+ significanceFactor : c . significance_factor ,
592
+ isDodgy : c . is_dodgy ,
593
+ datumA,
594
+ datumB,
595
+ percent,
596
+ } ;
597
+ } )
598
+ . filter ( tc => shouldShowTestCase ( tc ) )
606
599
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
600
// Sort by name first, so that there is a canonical ordering
640
- // of benches . This ensures the overall order is stable, even if
601
+ // of test cases . This ensures the overall order is stable, even if
641
602
// 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 ) ) ;
603
+ testCases . sort ( ( a , b ) => a . benchmark . localeCompare ( b . benchmark ) ) ;
604
+ testCases . sort ( ( a , b ) => Math . abs ( b . percent ) - Math . abs ( a . percent ) ) ;
644
605
645
- return benches ;
606
+ return testCases ;
646
607
} ,
647
608
bootstrapTotals ( ) {
648
609
const sum = bootstrap => Object . entries ( bootstrap ) . map ( e => e [ 1 ] / 1e9 ) . reduce ( ( sum , next ) => sum + next , 0 ) ;
@@ -699,7 +660,10 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
699
660
} ,
700
661
summary ( ) {
701
662
// 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 ] ) ) ) ;
663
+ const filtered = this . testCases . reduce ( ( sum , next ) => {
664
+ sum [ testCaseString ( next ) ] = true ;
665
+ return sum ;
666
+ } , { } ) ;
703
667
const newCount = { regressions : 0 , improvements : 0 , unchanged : 0 }
704
668
let result = { all : { ...newCount } , filtered : { ...newCount } }
705
669
for ( let d of this . data . comparisons ) {
@@ -734,15 +698,14 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
734
698
let klass = "" ;
735
699
if ( pct > 1 ) {
736
700
klass = 'positive' ;
737
- } else if ( pct >= 0.2 ) {
701
+ } else if ( pct > 0 ) {
738
702
klass = 'slightly-positive' ;
739
703
} else if ( pct < - 1 ) {
740
704
klass = 'negative' ;
741
- } else if ( pct <= - 0.2 ) {
705
+ } else if ( pct < - 0 ) {
742
706
klass = 'slightly-negative' ;
743
707
}
744
708
return klass ;
745
-
746
709
} ,
747
710
diffClass ( diff ) {
748
711
let klass = "" ;
@@ -754,11 +717,11 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
754
717
return klass ;
755
718
756
719
} ,
757
- detailedQueryLink ( commit , bench , testCase ) {
758
- return `/detailed-query.html?commit=${ commit } &benchmark=${ bench } &run_name=${ testCase } ` ;
720
+ detailedQueryLink ( commit , testCase ) {
721
+ return `/detailed-query.html?commit=${ commit } &benchmark=${ testCase . benchmark + "-" + testCase . profile } &run_name=${ testCase . scenario } ` ;
759
722
} ,
760
- percentLink ( commit , baseCommit , bench , testCase ) {
761
- return `/detailed-query.html?commit=${ commit } &base_commit=${ baseCommit } &benchmark=${ bench } &run_name=${ testCase } ` ;
723
+ percentLink ( commit , baseCommit , testCase ) {
724
+ return `/detailed-query.html?commit=${ commit } &base_commit=${ baseCommit } &benchmark=${ testCase . benchmark + "-" + testCase . profile } &run_name=${ testCase . scenario } ` ;
762
725
} ,
763
726
commitLink ( commit ) {
764
727
return `https://github.com/rust-lang/rust/commit/${ commit } ` ;
@@ -847,4 +810,4 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
847
810
</ script >
848
811
</ body >
849
812
850
- </ html >
813
+ </ html >
0 commit comments