@@ -315,6 +315,27 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
315
315
</ template >
316
316
</ tbody >
317
317
</ table >
318
+ < br />
319
+ < table class ="compare " v-if ="data && data.a.bootstrap ">
320
+ < tr >
321
+ < td colspan ="4 "> bootstrap timings; variance is 1-3% on smaller benchmarks! Values in seconds.</ td >
322
+ </ tr >
323
+ < tr >
324
+ < th > total</ th >
325
+ < th > {{bootstrapTotals.a.toFixed(3)}}</ th >
326
+ < th > {{bootstrapTotals.b.toFixed(3)}}</ th >
327
+ </ tr >
328
+ < template v-for ="bootstrap in bootstraps ">
329
+ < tr data-field-start ="true ">
330
+ < th style ="width: 19em; "> {{bootstrap.name}}</ th >
331
+ < td > {{bootstrap.a}}</ td >
332
+ < td > {{bootstrap.b}}</ td >
333
+ < td > < span
334
+ v-bind:class ="percentClass(bootstrap.percent) "> {{bootstrap.percent.toFixed(1)}}%</ span >
335
+ </ td >
336
+ </ tr >
337
+ </ template >
338
+ </ table >
318
339
</ div >
319
340
</ div >
320
341
< br >
@@ -479,7 +500,29 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
479
500
}
480
501
} ) ;
481
502
return fields ;
482
- }
503
+ } ,
504
+ bootstrapTotals ( ) {
505
+ const sum = bootstrap => Object . entries ( bootstrap ) . map ( e => e [ 1 ] / 1e9 ) . reduce ( ( sum , next ) => sum + next , 0 ) ;
506
+ const a = sum ( this . data . a . bootstrap ) ;
507
+ const b = sum ( this . data . b . bootstrap ) ;
508
+ return { a, b } ;
509
+ } ,
510
+ bootstraps ( ) {
511
+ console . log ( this . data . a . bootstrap ) ;
512
+ return Object . entries ( this . data . a . bootstrap ) . map ( e => {
513
+ const name = e [ 0 ] ;
514
+
515
+ const format = datum => datum . toLocaleString ( 'en-US' , { minimumFractionDigits : 3 , maximumFractionDigits : 3 } ) ;
516
+ const a = format ( e [ 1 ] / 1e9 ) ;
517
+ const b = format ( this . data . b . bootstrap [ name ] / 1e9 ) ;
518
+ return {
519
+ name,
520
+ a,
521
+ b,
522
+ percent : 100 * ( b - a ) / a
523
+ } ;
524
+ } ) . sort ( ( a , b ) => Math . abs ( b . percent ) - Math . abs ( a . percent ) ) ;
525
+ } ,
483
526
} ,
484
527
methods : {
485
528
short : function ( comparison ) {
0 commit comments