Skip to content

Commit

Permalink
align release text
Browse files Browse the repository at this point in the history
  • Loading branch information
acheronfail committed Jan 9, 2024
1 parent fae14d5 commit fae1eba
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 21 deletions.
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ measure what:

summary:
cd scripts && npm start -- --results ../results
cat scripts/summary.md

test what:
#!/usr/bin/env bash
Expand Down
57 changes: 36 additions & 21 deletions scripts/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,43 @@ const results = await Promise.all(
await writeFile(
'summary.md',
`
${markdownTable([
['name', 'command', 'version'],
...results
.slice()
.sort((a, b) => a.name.localeCompare(b.name))
.map(({ name, command, version }) => [name, command, version]),
])}
${markdownTable(
[
['name', 'command', 'version'],
...results
.slice()
.sort((a, b) => a.name.localeCompare(b.name))
.map(({ name, command, version }) => [name, command, version]),
],
{
align: ['l', 'l', 'l'],
}
)}
${markdownTable([
['name', 'mean'],
...results
.slice()
.sort((a, b) => a.mean - b.mean)
.map(({ name, mean }) => [name, formatTime(Math.floor(mean * 1_000_000_000), undefined, 5)]),
])}
${markdownTable(
[
['name', 'mean'],
...results
.slice()
.sort((a, b) => a.mean - b.mean)
.map(({ name, mean }) => [name, formatTime(Math.floor(mean * 1_000_000_000), undefined, 5)]),
],
{
align: ['l', 'r'],
}
)}
${markdownTable([
['name', 'max_rss'],
...results
.slice()
.sort((a, b) => a.max_rss - b.max_rss)
.map(({ name, max_rss }) => [name, formatSize(max_rss, { minimumFractionDigits: 7 })]),
])}
${markdownTable(
[
['name', 'max_rss'],
...results
.slice()
.sort((a, b) => a.max_rss - b.max_rss)
.map(({ name, max_rss }) => [name, formatSize(max_rss, { minimumFractionDigits: 7 })]),
],
{
align: ['l', 'r'],
}
)}
`.trim()
);

0 comments on commit fae1eba

Please sign in to comment.