typescript-runtime-type-benchmarks
typescript-runtime-type-benchmarks copied to clipboard
Add Node and Bun labels to bars in chart
It's very difficult to tell which bar belongs to which runtime in the chart. It would be good add a label so it's clear. Ideally, it would be formatted as <Node version> <V8 version> e.g. Node v22.12.0 V8 12.4.254.21-node.21. For Bun, it would be very similar <Bun version> <WebKit version> e.g. Bun 1.1.43 WebKit 2.47.2.
Getting the Node versions is very easy:
node --version
// v22.12.0
node -p process.versions.v8
// 12.4.254.21-node.21
For Bun it's a little bit less easy:
bun --version
// 1.1.43
bun bun-version.js
// 2.47.2
bun-version.js
// `process.versions.webkit` gives the commit hash of the forked WebKit.
const releases = await fetch(
`https://raw.githubusercontent.com/oven-sh/WebKit/${process.versions.webkit}/Source/WebKit/wpe/NEWS`,
).then(response => response.text());
const release = releases
.matchAll(/^WPE WebKit (?<release>\d+\.\d+\.\d)+$/gm)
.map(m => m.groups.release)
.next().value;
console.log(release);
I wanted to add it, but I failed to do it with current graph lib, there are other issues where we discuss changing it to something more modern and versatile