r/coolgithubprojects • u/rijshrest • 2m ago
TabBench: how much slower Linux programs run in a browser tab
github.comI made a benchmark for runtimes 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.
The runtimes:
- unkernel: the Linux kernel compiled to WebAssembly, running arm64 binaries on an emulated CPU
- CheerpX: an x86-to-WebAssembly JIT, the engine behind WebVM
- BrowserPod: 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): each result as a ratio to native. Only the commands are timed, after everything has booted.
The runtimes:
- unkernel: the Linux kernel compiled to WebAssembly, running arm64 binaries on an emulated CPU
- CheerpX: an x86-to-WebAssembly JIT, the engine behind WebVM
- BrowserPod: 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):
| Workload | BrowserPod | CheerpX | unkernel |
|---|---|---|---|
| Shell tools | 1.4-5.8x | 3.6-8.9x | 4.1-22x |
| JavaScript | 1.4-5.1x | 32-58x | 33-49x |
| npm ci | 9.6x | not run yet | 31x |
I plan to add other runtimes, such as v86, JSLinux, container2wasm and WebContainers.
Disclosure: I work for 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
