diff --git a/justfile b/justfile index 9337fc6..68ab00f 100644 --- a/justfile +++ b/justfile @@ -87,6 +87,7 @@ measure what: summary: cd scripts && npm start -- --results ../results + cat scripts/summary.md test what: #!/usr/bin/env bash diff --git a/scripts/summary.js b/scripts/summary.js index 0a57a75..f651abc 100644 --- a/scripts/summary.js +++ b/scripts/summary.js @@ -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() );