docs: adjust padding for benchmark comparison

This commit is contained in:
Johann Schopplich
2025-10-30 15:19:16 +01:00
parent 2c4f3c4362
commit fb43bdf527
5 changed files with 83 additions and 83 deletions

View File

@@ -116,7 +116,7 @@ const datasetRows = results
const comparisonLines = formatOrder.map((formatName) => { const comparisonLines = formatOrder.map((formatName) => {
const format = result.formats.find(f => f.name === formatName)! const format = result.formats.find(f => f.name === formatName)!
const label = FORMATTER_DISPLAY_NAMES[formatName] || formatName.toUpperCase() const label = FORMATTER_DISPLAY_NAMES[formatName] || formatName.toUpperCase()
const labelWithSavings = `vs ${label} (-${format.savingsPercent}%)`.padEnd(28) const labelWithSavings = `vs ${label} (-${format.savingsPercent}%)`.padEnd(27)
const tokenStr = format.tokens.toLocaleString('en-US').padStart(6) const tokenStr = format.tokens.toLocaleString('en-US').padStart(6)
return ` ${labelWithSavings}${tokenStr}` return ` ${labelWithSavings}${tokenStr}`
}) })
@@ -140,7 +140,7 @@ const totalComparisonLines = formatOrder.map((formatName) => {
const label = FORMATTER_DISPLAY_NAMES[formatName] || formatName.toUpperCase() const label = FORMATTER_DISPLAY_NAMES[formatName] || formatName.toUpperCase()
const tokens = totalTokensByFormat[formatName]! const tokens = totalTokensByFormat[formatName]!
const percent = totalSavingsPercent[formatName]! const percent = totalSavingsPercent[formatName]!
const labelWithSavings = `vs ${label} (-${percent}%)`.padEnd(28) const labelWithSavings = `vs ${label} (-${percent}%)`.padEnd(27)
const tokenStr = tokens.toLocaleString('en-US').padStart(6) const tokenStr = tokens.toLocaleString('en-US').padStart(6)
return ` ${labelWithSavings}${tokenStr}` return ` ${labelWithSavings}${tokenStr}`
}) })