diff options
author | 2023-05-10 23:03:37 -0700 | |
---|---|---|
committer | 2023-05-10 23:03:37 -0700 | |
commit | 9d3a95ed966648367a327c10aaaf32bb22aab474 (patch) | |
tree | ca79f5d939dbf77bea0111e91a5565869159f380 /bench/snippets | |
parent | 2abfa84db75fecce1d15fb8e011d27b5e70bded6 (diff) | |
download | bun-9d3a95ed966648367a327c10aaaf32bb22aab474.tar.gz bun-9d3a95ed966648367a327c10aaaf32bb22aab474.tar.zst bun-9d3a95ed966648367a327c10aaaf32bb22aab474.zip |
Add version
Diffstat (limited to 'bench/snippets')
-rw-r--r-- | bench/snippets/runner-entrypoint.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bench/snippets/runner-entrypoint.js b/bench/snippets/runner-entrypoint.js index efb21d860..31a0b1b56 100644 --- a/bench/snippets/runner-entrypoint.js +++ b/bench/snippets/runner-entrypoint.js @@ -140,13 +140,18 @@ function* run({ cmds, file }) { const spawnElapsed = performance.now() - spawnStart; stdout = stdout.toString(); try { + const json = JSON.parse(stdout.trim()); yield { file: file, benchmarkID, - result: JSON.parse(stdout.trim()), + result: json, runtime: runtime, timestamp, elapsed: spawnElapsed, + runtimeVersion: (runtime === "bun" + ? `${Bun.version}-${Bun.revision}` + : String(json?.runtime).split(" ").at(1) + ).replace(/^v/, ""), }; } catch (e) { console.error("Failing file", file); @@ -166,8 +171,9 @@ for (let result of scan()) { for (let { runtime, benchmarkID, + runtimeVersion, result: { benchmarks }, } of run(result)) { - console.log({ runtime, id: benchmarkID, benchmarks }); + console.log({ runtime, runtimeVersion, id: benchmarkID, benchmarks }); } } |