From 18030768c634f9f88176895770390b49ad9e3d62 Mon Sep 17 00:00:00 2001 From: uki00a Date: Sat, 21 Oct 2023 17:58:59 +0900 Subject: [PATCH] fix: ordering --- tools/format-benchmark-results.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/format-benchmark-results.js b/tools/format-benchmark-results.js index a4d87fdc..4f906576 100644 --- a/tools/format-benchmark-results.js +++ b/tools/format-benchmark-results.js @@ -28,10 +28,11 @@ function makeTableRow(columns) { } const resultsDir = new URL("../tmp/benchmark", import.meta.url); -for await (const entry of Deno.readDir(resultsDir)) { - const results = JSON.parse( - await Deno.readTextFile(join(resultsDir.pathname, entry.name)), - ); +const paths = Array.from(Deno.readDirSync(resultsDir)).map((x) => + join(resultsDir.pathname, x.name) +).sort(); +for (const path of paths) { + const results = JSON.parse(await Deno.readTextFile(path)); const markdown = formatResultsAsMarkdown(results); console.log(markdown); }