Skip to content
Myr

Tweak perf output formatting

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Mark Erikson · committed by Mark Erikson · parent 964e3b3 · Browse files · 1 file+5 added−27 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−27 removed

  • other:+5 added−27 removed

1 file+5 added−27 removed

modified:perf-testing/immutability-benchmarks.mjs+5 added-27 removed
178 unmodified lines
179 add,180 remove,181 filter,182 update,183 updateLargeObject1,184 updateLargeObject2,183 concat,184 mapNested,185 // dash-named fields to improve readability in benchmark results186187 "update-largeObject1": updateLargeObject1,188 "update-largeObject2": updateLargeObject2,189 "update-high": updateHigh,190 "update-multiple": updateMultiple,191 "remove-high": removeHigh,192 "sortById-reverse": sortByIdReverse,
428 unmodified lines
621 "update",622 "update-high",623 "remove",624 "remove-high",624 "updateLargeObject1",625 "updateLargeObject2"625 "update-largeObject1",626 "update-largeObject2"627 ]628 for (const action of reuseActions) {629 summary(function() {630 bench(`$action-reuse: $version (freeze: $freeze)`, function*(args) {
585 unmodified lines
1216 console.log("No version data available for overall rankings.")1217 return1218 }12191219 console.log(1220 "\nMethodology: Lower geometric mean = better overall performance"1221 )1222 console.log(1223 "(Geometric mean is standard for benchmarking as it handles multiplicative performance differences)"1224 )12251220 console.log("\n┌──────┬─────────────────────┬─────────────────┬───────────┐")1221 console.log("│ Rank │ Version │ Geometric Mean │ Scenarios │")1222 console.log("├──────┼─────────────────────┼─────────────────┼───────────┤")1223
10 unmodified lines
1234 console.log(`│ ${rank} │ ${displayName} │ ${geoMean} │ ${scenarios} │`)1235 }12361237 console.log("└──────┴─────────────────────┴─────────────────┴───────────┘")12441245 // Highlight top performers1246 if (versionScores.length >= 3) {1247 console.log("\nTop Overall Performers:")1248 for (let i = 0; i < Math.min(10, versionScores.length); i++) {1249 const score = versionScores[i]1250 const [versionName, freezeIndicator] = score.version.split("|")1251 const shortName = shortenVersionName(versionName)1252 console.log(1253 ` ${i +1254 1}. ${shortName} (${freezeIndicator}) - ${score.geometricMean.toFixed(1255 21256 )}x average`1257 )1258 }1259 }1238}12391240function printBenchmarkSummaryTable(benchmarks) {1241 try {
43 unmodified lines