MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / printBenchTable

Function printBenchTable

test/big-decimal/comprehensive-benchmark.ts:114–125  ·  view source on GitHub ↗
(results: BenchResult[])

Source from the content-addressed store, hash-verified

112}
113
114function printBenchTable(results: BenchResult[]) {
115 const nameW = Math.max(25, ...results.map((r) => r.name.length));
116 console.log(
117 ` ${'Operation'.padEnd(nameW)} ${'BigDecimal'.padStart(10)} ${'Decimal.js'.padStart(10)} ${'Speedup'.padStart(15)}`
118 );
119 console.log(` ${'─'.repeat(nameW)} ${'─'.repeat(10)} ${'─'.repeat(10)} ${'─'.repeat(15)}`);
120 for (const r of results) {
121 console.log(
122 ` ${r.name.padEnd(nameW)} ${formatMs(r.bdMs).padStart(10)} ${formatMs(r.djMs).padStart(10)} ${formatSpeedup(r.speedup).padStart(15 + 9)}`
123 );
124 }
125}
126
127function printAccuracyTable(results: AccuracyResult[]) {
128 console.log(

Callers 1

Calls 4

formatMsFunction · 0.85
formatSpeedupFunction · 0.85
mapMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected