File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,10 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
419
419
</ span >
420
420
</ div >
421
421
</ div >
422
+ < div class ="section ">
423
+ < span style ="font-weight: bold; width: 30%; margin-left: 15%; "> Geometric mean</ span >
424
+ < span v-bind:class ="percentClass(geoMean) "> {{ geoMean.toFixed(2) }}%</ span >
425
+ </ div >
422
426
</ div >
423
427
< table id ="benches " class ="compare ">
424
428
< tbody >
@@ -703,6 +707,21 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
703
707
stat ( ) {
704
708
return findQueryParam ( "stat" ) || "instructions:u" ;
705
709
} ,
710
+ geoMean ( ) {
711
+ if ( this . data === null ) {
712
+ return "N/A" ;
713
+ }
714
+
715
+ let geomean = 1 ;
716
+ for ( let d of this . data . comparisons ) {
717
+ const datumA = d . statistics [ 0 ] ;
718
+ const datumB = d . statistics [ 1 ] ;
719
+ const percent = 100 * ( ( datumB - datumA ) / datumA ) ;
720
+ geomean *= percent + 100 ;
721
+ }
722
+ geomean = Math . pow ( geomean , 1.0 / this . data . comparisons . length ) ;
723
+ return geomean - 100 ;
724
+ } ,
706
725
summary ( ) {
707
726
// Create object with each test case that is not filtered out as a key
708
727
const filtered = Object . fromEntries ( this . benches . flatMap ( b => b . testCases . map ( v => [ b . name + "-" + v . scenario , true ] ) ) ) ;
You can’t perform that action at this time.
0 commit comments