r/javascript • • 2d ago

TabBench: benchmarking Linux-in-browser implementations - Unkernel vs. WebVM vs. BrowserPod

https://github.com/leaningtech/tabbench

TabBench is a reproducible benchmark suite for libraries that run Linux programs in a browser tab. It runs the same commands natively and in each runtime on the same machine, and reports each result as a ratio to native. Only the commands are timed, after everything has booted.

It currently support three runtimes:

- [unkernel](https://github.com/pithings/unkernel): the Linux kernel compiled to WebAssembly, running arm64 binaries on an emulated CPU

- [CheerpX](https://cheerpx.io): an x86-to-WebAssembly JIT, the engine behind WebVM

- [BrowserPod](https://browserpod.io): programs compiled to WebAssembly ahead of time, with JavaScript on the browser's own engine

The workloads are shell tools (sort, gzip, sha256sum, find and a shell loop) and Node tools (npm ci, ESLint, the acorn parser and a CPU benchmark from unkernel's tests).Results, as a ratio to native (lower is faster):

- Shell tools: BrowserPod 1.4–5.8×, CheerpX 3.6–8.9×, unkernel 4.1–22×

- JavaScript: BrowserPod 1.4–5.1×, CheerpX 32–58×, unkernel 33–49×

- npm ci: BrowserPod 9.6×, unkernel 31×

We plan to add other runtimes, such as v86, JSLinux, container2wasm and WebContainers.

Disclosure: I am the lead engineer and CTO of Leaning Technologies, we make BrowserPod and CheerpX. The test suite is public and can be replicated, and PRs from maintainers of other runtimes are welcome.

Full description and results: https://github.com/leaningtech/tabbench

4 Upvotes

4 comments sorted by

1

u/Opposite_Sector2145 2d ago

If you want to replicate these TabBench results, make sure you use the exact commands listed in the README and run them after everything has finished booting. Timing before all initialization completes will give totally different numbers.

1

u/na-6381989 1d ago

For the JavaScript row, are Node version and build held constant across runtimes, or is that part of each port? That distinction would help interpret the gap.

1

u/makisever4 1d ago

Does the JavaScript range exclude npm ci and cover the other Node workloads? Since npm ci gets its own row, spelling out the split would make the ratios easier to interpret.