285
285
text-align : center;
286
286
}
287
287
</ style >
288
- < script src ="https://cdn.jsdelivr.net/npm/vue@2 /dist/vue.min .js "> </ script >
288
+ < script src ="https://cdn.jsdelivr.net/npm/vue@3 /dist/vue.global.prod .js "> </ script >
289
289
</ head >
290
290
291
291
< body >
@@ -616,114 +616,32 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
616
616
}
617
617
}
618
618
619
- Vue . mixin ( {
620
- methods : {
621
- percentClass ( pct ) {
622
- let klass = "" ;
623
- if ( pct > 1 ) {
624
- klass = 'positive' ;
625
- } else if ( pct > 0 ) {
626
- klass = 'slightly-positive' ;
627
- } else if ( pct < - 1 ) {
628
- klass = 'negative' ;
629
- } else if ( pct < - 0 ) {
630
- klass = 'slightly-negative' ;
631
- }
632
- return klass ;
633
- } ,
634
- }
635
- } ) ;
636
- Vue . component ( 'test-cases-table' , {
637
- props : [ 'cases' , 'showRawData' , 'commitA' , 'commitB' , 'before' , 'after' , 'title' ] ,
638
- methods : {
639
- detailedQueryLink ( commit , testCase ) {
640
- return `/detailed-query.html?commit=${ commit } &benchmark=${ testCase . benchmark + "-" + testCase . profile } &scenario=${ testCase . scenario } ` ;
641
- } ,
642
- percentLink ( commit , baseCommit , testCase ) {
643
- return `/detailed-query.html?commit=${ commit } &base_commit=${ baseCommit } &benchmark=${ testCase . benchmark + "-" + testCase . profile } &scenario=${ testCase . scenario } ` ;
644
- } ,
619
+ const app = Vue . createApp ( {
620
+ mounted ( ) {
621
+ const app = this ;
622
+ loadState ( state => makeData ( state , app ) ) ;
645
623
} ,
646
- template : `
647
- <div class="bench-table">
648
- <div class="category-title">{{ title }} benchmarks</div>
649
- <div v-if="cases.length === 0" style="text-align: center;">
650
- No results
651
- </div>
652
- <table v-else class="benches compare">
653
- <thead>
654
- <tr>
655
- <th>Benchmark & Profile</th>
656
- <th>Scenario</th>
657
- <th>% Change</th>
658
- <th>
659
- Significance Factor
660
- <span class="tooltip">?
661
- <span class="tooltiptext">
662
- How much a particular result is over the significance threshold. A factor of 2.50x
663
- means
664
- the result is 2.5 times over the significance threshold. You can see <a
665
- href="https://github.com/rust-lang/rustc-perf/blob/master/docs/comparison-analysis.md#what-makes-a-test-result-significant">
666
- here</a> how the significance threshold is calculated.
667
- </span>
668
- </span>
669
- </th>
670
- <th v-if="showRawData">{{ before }}</th>
671
- <th v-if="showRawData">{{ after }}</th>
672
- </tr>
673
- </thead>
674
- <tbody>
675
- <template v-for="testCase in cases">
676
- <tr>
677
- <td>{{ testCase.benchmark }} {{ testCase.profile }}</td>
678
- <td>{{ testCase.scenario }}</td>
679
- <td>
680
- <a v-bind:href="percentLink(commitB, commitA, testCase)">
681
- <span v-bind:class="percentClass(testCase.percent)">
682
- {{ testCase.percent.toFixed(2) }}%{{testCase.isDodgy ? "?" : ""}}
683
- </span>
684
- </a>
685
- </td>
686
- <td>
687
- {{ testCase.significanceFactor ? testCase.significanceFactor.toFixed(2) + "x" : "-" }}
688
- </td>
689
- <td v-if="showRawData">
690
- <a v-bind:href="detailedQueryLink(commitA, testCase)">
691
- <abbr :title="testCase.datumA">{{ testCase.datumA.toFixed(2) }}</abbr>
692
- </a>
693
- </td>
694
- <td v-if="showRawData">
695
- <a v-bind:href="detailedQueryLink(commitB, testCase)">
696
- <abbr :title="testCase.datumB">{{ testCase.datumB.toFixed(2) }}</abbr>
697
- </a>
698
- </td>
699
- </tr>
700
- </template>
701
- </tbody>
702
- </table>
703
- </div>
704
- ` } ) ;
705
-
706
- let app = new Vue ( {
707
- el : '#app' ,
708
- data : {
709
- filter : {
710
- name : null ,
711
- showOnlySignificant : true ,
712
- filterVerySmall : true ,
713
- scenario : {
714
- full : true ,
715
- incrFull : true ,
716
- incrUnchanged : true ,
717
- incrPatched : true
624
+ data ( ) {
625
+ return {
626
+ filter : {
627
+ name : null ,
628
+ showOnlySignificant : true ,
629
+ filterVerySmall : true ,
630
+ scenario : {
631
+ full : true ,
632
+ incrFull : true ,
633
+ incrUnchanged : true ,
634
+ incrPatched : true
635
+ } ,
636
+ category : {
637
+ primary : true ,
638
+ secondary : true
639
+ }
718
640
} ,
719
- category : {
720
- primary : true ,
721
- secondary : true
722
- }
723
- } ,
724
- showRawData : false ,
725
- data : null ,
726
- dataLoading : false
641
+ showRawData : false ,
642
+ data : null ,
643
+ dataLoading : false
644
+ }
727
645
} ,
728
646
computed : {
729
647
notContinuous ( ) {
@@ -982,6 +900,94 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
982
900
} ,
983
901
} ) ;
984
902
903
+ app . component ( 'test-cases-table' , {
904
+ props : [ 'cases' , 'showRawData' , 'commitA' , 'commitB' , 'before' , 'after' , 'title' ] ,
905
+ methods : {
906
+ detailedQueryLink ( commit , testCase ) {
907
+ return `/detailed-query.html?commit=${ commit } &benchmark=${ testCase . benchmark + "-" + testCase . profile } &scenario=${ testCase . scenario } ` ;
908
+ } ,
909
+ percentLink ( commit , baseCommit , testCase ) {
910
+ return `/detailed-query.html?commit=${ commit } &base_commit=${ baseCommit } &benchmark=${ testCase . benchmark + "-" + testCase . profile } &scenario=${ testCase . scenario } ` ;
911
+ } ,
912
+ } ,
913
+ template : `
914
+ <div class="bench-table">
915
+ <div class="category-title">{{ title }} benchmarks</div>
916
+ <div v-if="cases.length === 0" style="text-align: center;">
917
+ No results
918
+ </div>
919
+ <table v-else class="benches compare">
920
+ <thead>
921
+ <tr>
922
+ <th>Benchmark & Profile</th>
923
+ <th>Scenario</th>
924
+ <th>% Change</th>
925
+ <th>
926
+ Significance Factor
927
+ <span class="tooltip">?
928
+ <span class="tooltiptext">
929
+ How much a particular result is over the significance threshold. A factor of 2.50x
930
+ means
931
+ the result is 2.5 times over the significance threshold. You can see <a
932
+ href="https://github.com/rust-lang/rustc-perf/blob/master/docs/comparison-analysis.md#what-makes-a-test-result-significant">
933
+ here</a> how the significance threshold is calculated.
934
+ </span>
935
+ </span>
936
+ </th>
937
+ <th v-if="showRawData">{{ before }}</th>
938
+ <th v-if="showRawData">{{ after }}</th>
939
+ </tr>
940
+ </thead>
941
+ <tbody>
942
+ <template v-for="testCase in cases">
943
+ <tr>
944
+ <td>{{ testCase.benchmark }} {{ testCase.profile }}</td>
945
+ <td>{{ testCase.scenario }}</td>
946
+ <td>
947
+ <a v-bind:href="percentLink(commitB, commitA, testCase)">
948
+ <span v-bind:class="percentClass(testCase.percent)">
949
+ {{ testCase.percent.toFixed(2) }}%{{testCase.isDodgy ? "?" : ""}}
950
+ </span>
951
+ </a>
952
+ </td>
953
+ <td>
954
+ {{ testCase.significanceFactor ? testCase.significanceFactor.toFixed(2) + "x" : "-" }}
955
+ </td>
956
+ <td v-if="showRawData">
957
+ <a v-bind:href="detailedQueryLink(commitA, testCase)">
958
+ <abbr :title="testCase.datumA">{{ testCase.datumA.toFixed(2) }}</abbr>
959
+ </a>
960
+ </td>
961
+ <td v-if="showRawData">
962
+ <a v-bind:href="detailedQueryLink(commitB, testCase)">
963
+ <abbr :title="testCase.datumB">{{ testCase.datumB.toFixed(2) }}</abbr>
964
+ </a>
965
+ </td>
966
+ </tr>
967
+ </template>
968
+ </tbody>
969
+ </table>
970
+ </div>
971
+ ` } ) ;
972
+ app . mixin ( {
973
+ methods : {
974
+ percentClass ( pct ) {
975
+ let klass = "" ;
976
+ if ( pct > 1 ) {
977
+ klass = 'positive' ;
978
+ } else if ( pct > 0 ) {
979
+ klass = 'slightly-positive' ;
980
+ } else if ( pct < - 1 ) {
981
+ klass = 'negative' ;
982
+ } else if ( pct < - 0 ) {
983
+ klass = 'slightly-negative' ;
984
+ }
985
+ return klass ;
986
+ } ,
987
+ }
988
+ } ) ;
989
+
990
+
985
991
function toggleFilters ( id , toggle ) {
986
992
let styles = document . getElementById ( id ) . style ;
987
993
let indicator = document . getElementById ( toggle ) ;
@@ -1015,7 +1021,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
1015
1021
return commit . substring ( 0 , 8 ) ;
1016
1022
}
1017
1023
1018
- function makeData ( state ) {
1024
+ function makeData ( state , app ) {
1019
1025
app . dataLoading = true ;
1020
1026
let values = Object . assign ( { } , {
1021
1027
start : "" ,
@@ -1040,7 +1046,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
1040
1046
window . location . search = params . toString ( ) ;
1041
1047
}
1042
1048
1043
- loadState ( makeData ) ;
1049
+ app . mount ( '#app' ) ;
1044
1050
</ script >
1045
1051
</ body >
1046
1052
0 commit comments