@@ -24,6 +24,7 @@ interface State {
24
24
sortKey : string ;
25
25
compareWith : Framework | undefined ;
26
26
useMedian : boolean ;
27
+ highlightVariance : boolean ;
27
28
}
28
29
29
30
let allBenchmarks = ( ) => benchmarks . reduce ( ( set , b ) => set . add ( b ) , new Set ( ) ) ;
@@ -36,14 +37,14 @@ let resultLookup = convertToMap(results);
36
37
37
38
class App extends React . Component < { } , State > {
38
39
benchSelect = ( benchmarkType : BenchmarkType ) => ( {
39
- selectAll : ( event : React . SyntheticEvent < any > ) => {
40
+ selectAll : ( event : React . SyntheticEvent < any > ) => {
40
41
event . preventDefault ( ) ;
41
42
let set = this . state . selectedBenchmarks ;
42
43
benchmarks . forEach ( b => { if ( b . type === benchmarkType ) set . add ( b ) ; } ) ;
43
44
this . nextState . selectedBenchmarks = set ;
44
45
this . setState ( { selectedBenchmarks : set , resultTables : this . updateResultTable ( ) } ) ;
45
46
} ,
46
- selectNone : ( event : React . SyntheticEvent < any > ) => {
47
+ selectNone : ( event : React . SyntheticEvent < any > ) => {
47
48
event . preventDefault ( ) ;
48
49
let set = this . state . selectedBenchmarks ;
49
50
benchmarks . forEach ( b => { if ( b . type === benchmarkType ) set . delete ( b ) ; } ) ;
@@ -58,14 +59,14 @@ class App extends React.Component<{}, State> {
58
59
isSelected : ( benchmark : Benchmark ) => this . state . selectedBenchmarks . has ( benchmark )
59
60
} )
60
61
frameworkSelect = ( keyed : boolean ) => ( {
61
- selectAll : ( event : React . SyntheticEvent < any > ) => {
62
+ selectAll : ( event : React . SyntheticEvent < any > ) => {
62
63
event . preventDefault ( ) ;
63
64
let set = this . state . selectedFrameworks ;
64
65
frameworks . forEach ( framework => { if ( framework . keyed === keyed && ! set . has ( framework ) ) set . add ( framework ) ; } ) ;
65
66
this . nextState . selectedFrameworks = set ;
66
67
this . setState ( { selectedFrameworks : set , resultTables : this . updateResultTable ( ) } ) ;
67
68
} ,
68
- selectNone : ( event : React . SyntheticEvent < any > ) => {
69
+ selectNone : ( event : React . SyntheticEvent < any > ) => {
69
70
event . preventDefault ( ) ;
70
71
let set = this . state . selectedFrameworks ;
71
72
set . forEach ( framework => { if ( framework . keyed === keyed ) set . delete ( framework ) ; } ) ;
@@ -85,7 +86,7 @@ class App extends React.Component<{}, State> {
85
86
86
87
constructor ( props : object ) {
87
88
super ( props ) ;
88
- this . nextState = { benchmarks,
89
+ this . nextState = { benchmarks,
89
90
benchmarksCPU : benchmarks . filter ( b => b . type === BenchmarkType . CPU ) ,
90
91
benchmarksStartup : benchmarks . filter ( b => b . type === BenchmarkType . STARTUP ) ,
91
92
benchmarksMEM : benchmarks . filter ( b => b . type === BenchmarkType . MEM ) ,
@@ -99,6 +100,7 @@ class App extends React.Component<{}, State> {
99
100
sortKey : SORT_BY_GEOMMEAN ,
100
101
compareWith : undefined ,
101
102
useMedian : false ,
103
+ highlightVariance : false
102
104
} ;
103
105
this . nextState . resultTables = this . updateResultTable ( ) ;
104
106
this . state = this . nextState ;
@@ -122,7 +124,7 @@ class App extends React.Component<{}, State> {
122
124
else set . add ( framework ) ;
123
125
this . nextState . selectedFrameworks = set ;
124
126
this . setState ( { selectedFrameworks : set , resultTables : this . updateResultTable ( ) } ) ;
125
- }
127
+ }
126
128
selectSeparateKeyedAndNonKeyed = ( value : boolean ) : void => {
127
129
this . nextState . separateKeyedAndNonKeyed = value ;
128
130
this . setState ( { separateKeyedAndNonKeyed : value , resultTables : this . updateResultTable ( ) } ) ;
@@ -131,12 +133,16 @@ class App extends React.Component<{}, State> {
131
133
this . nextState . useMedian = value ;
132
134
this . setState ( { useMedian : value , resultTables : this . updateResultTable ( ) } ) ;
133
135
}
136
+ selectHighlightVariance = ( value : boolean ) : void => {
137
+ this . nextState . highlightVariance = value ;
138
+ this . setState ( { highlightVariance : value , resultTables : this . updateResultTable ( ) } ) ;
139
+ }
134
140
updateResultTable ( ) {
135
141
if ( this . nextState . separateKeyedAndNonKeyed ) {
136
- return [ new ResultTableData ( frameworks , benchmarks , resultLookup , this . nextState . selectedFrameworks , this . nextState . selectedBenchmarks , false , this . nextState . sortKey , this . nextState . compareWith , this . nextState . useMedian ) ,
137
- new ResultTableData ( frameworks , benchmarks , resultLookup , this . nextState . selectedFrameworks , this . nextState . selectedBenchmarks , true , this . nextState . sortKey , this . nextState . compareWith , this . nextState . useMedian ) ]
142
+ return [ new ResultTableData ( frameworks , benchmarks , resultLookup , this . nextState . selectedFrameworks , this . nextState . selectedBenchmarks , false , this . nextState . sortKey , this . nextState . compareWith , this . nextState . useMedian , this . nextState . highlightVariance ) ,
143
+ new ResultTableData ( frameworks , benchmarks , resultLookup , this . nextState . selectedFrameworks , this . nextState . selectedBenchmarks , true , this . nextState . sortKey , this . nextState . compareWith , this . nextState . useMedian , this . nextState . highlightVariance ) ]
138
144
} else {
139
- return [ new ResultTableData ( frameworks , benchmarks , resultLookup , this . nextState . selectedFrameworks , this . nextState . selectedBenchmarks , undefined , this . nextState . sortKey , this . nextState . compareWith , this . nextState . useMedian ) ]
145
+ return [ new ResultTableData ( frameworks , benchmarks , resultLookup , this . nextState . selectedFrameworks , this . nextState . selectedBenchmarks , undefined , this . nextState . sortKey , this . nextState . compareWith , this . nextState . useMedian , this . nextState . highlightVariance ) ]
140
146
}
141
147
}
142
148
selectComparison = ( framework : string ) : void => {
@@ -157,19 +163,19 @@ class App extends React.Component<{}, State> {
157
163
render ( ) {
158
164
let disclaimer = ( false ) ? ( < div >
159
165
< h2 > Results for js web frameworks benchmark – round 7</ h2 >
160
- < p > Go here for the accompanying article < a href = "http://www.stefankrause.net/wp/?p=454" > http://www.stefankrause.net/wp/?p=454</ a > . Source code can be found in the github < a href = "https://github.com/krausest/js-framework-benchmark" > repository</ a > .</ p >
166
+ < p > Go here for the accompanying article < a href = "http://www.stefankrause.net/wp/?p=454" > http://www.stefankrause.net/wp/?p=454</ a > . Source code can be found in the github < a href = "https://github.com/krausest/js-framework-benchmark" > repository</ a > .</ p >
161
167
</ div > ) :
162
168
( < p > Warning: These results are preliminary - use with caution (they may e.g. be from different browser versions).Official results are published on my < a href = "http://www.stefankrause.net/" > blog</ a > .</ p > ) ;
163
169
164
170
return (
165
- < div >
171
+ < div >
166
172
{ disclaimer }
167
- < p > The benchmark was run on a MacBook Pro 15 (2,5 GHz i7, 16 GB RAM, OSX 10.13.1, Chrome 62.0.3202.94 (64-bit))</ p >
168
- < SelectBar benchmarksCPU = { this . state . benchmarksCPU }
173
+ < p > The benchmark was run on a MacBook Pro 15 (2,5 GHz i7, 16 GB RAM, OSX 10.13.1, Chrome 62.0.3202.94 (64-bit))</ p >
174
+ < SelectBar benchmarksCPU = { this . state . benchmarksCPU }
169
175
benchmarksStartup = { this . state . benchmarksStartup }
170
- benchmarksMEM = { this . state . benchmarksMEM }
171
- frameworksKeyed = { this . state . frameworksKeyed }
172
- frameworksNonKeyed = { this . state . frameworksNonKeyed }
176
+ benchmarksMEM = { this . state . benchmarksMEM }
177
+ frameworksKeyed = { this . state . frameworksKeyed }
178
+ frameworksNonKeyed = { this . state . frameworksNonKeyed }
173
179
frameworkSelectKeyed = { this . frameworkSelectKeyed }
174
180
frameworkSelectNonKeyed = { this . frameworkSelectNonKeyed }
175
181
benchSelectCpu = { this . benchSelectCpu }
@@ -183,10 +189,12 @@ class App extends React.Component<{}, State> {
183
189
selectComparison = { this . selectComparison }
184
190
useMedian = { this . state . useMedian }
185
191
selectMedian = { this . selectMedian }
192
+ highlightVariance = { this . state . highlightVariance }
193
+ selectHighlightVariance = { this . selectHighlightVariance }
186
194
/>
187
- { ! this . state . compareWith ? null :
188
- ( < p style = { { marginTop :'10px' } } > In comparison mode white cells mean there's no statistically significant difference.
189
- Green cells are significantly faster than the comparison and red cells are slower.
195
+ { ! this . state . compareWith ? null :
196
+ ( < p style = { { marginTop :'10px' } } > In comparison mode white cells mean there's no statistically significant difference.
197
+ Green cells are significantly faster than the comparison and red cells are slower.
190
198
The test is performed as a one sided t-test. The significance level is 10%. The darker the color the lower the p-Value.</ p >
191
199
) }
192
200
< ResultTable currentSortKey = { this . state . sortKey } data = { this . state . resultTables } separateKeyedAndNonKeyed = { this . state . separateKeyedAndNonKeyed } sortBy = { this . sortBy } />
0 commit comments