Skip to content

Commit 2b10fb0

Browse files
committed
Bootstrap
1 parent e669068 commit 2b10fb0

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

site/static/compare.html

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,27 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
315315
</template>
316316
</tbody>
317317
</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>
318339
</div>
319340
</div>
320341
<br>
@@ -479,7 +500,29 @@ <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="bef
479500
}
480501
});
481502
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+
},
483526
},
484527
methods: {
485528
short: function (comparison) {

0 commit comments

Comments
 (0)