r/coolgithubprojects • • 17m ago

TabBench: how much slower Linux programs run in a browser tab

https://github.com/leaningtech/tabbench

I 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):

WorkloadBrowserPodCheerpXunkernel
Shell tools1.4-5.8x3.6-8.9x4.1-22x
JavaScript1.4-5.1x32-58x33-49x
npm ci9.6xnot run yet31x

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

1 Upvotes

0 comments sorted by