Skip to content
leaningtechPublic

About

Benchmark suite for Linux runtimes in the browser

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

TabBench: a benchmark for Linux runtimes in the browser

TabBench measures the performance of Linux-in-the-browser runtimes: systems that run Linux workloads inside a browser tab, on the user's device, with no server behind them. It runs the same commands on each runtime and natively on the same machine, and reports each result as a ratio to native.

The commands cover command-line programs (the BusyBox shell, sort, sha256sum, gzip, find) and Node.js programs (npm, ESLint, a JavaScript parser). More languages will follow. Every runtime gets the same commands and the same inputs, checked by hash. Only the commands are timed: booting, setup and copying the inputs in all happen first. Anyone can reproduce the numbers on their own machine.

The baseline is native: the same commands in an Alpine container on the same machine.

What it compares

Runtimes differ in which layers of a Linux system they emulate and which run as WebAssembly. TabBench compares these kinds:

  • Full system emulation. An emulated CPU boots an unmodified Linux kernel, which runs unmodified binaries. Examples are v86, JSLinux and waarm64; they are on the roadmap.
  • Linux kernel compiled to WebAssembly. The kernel runs as WebAssembly, and user programs are unmodified binaries on an emulated CPU. unkernel runs arm64 Alpine this way. It is by Pooya Parsa and is MIT-licensed.
  • Binary translation without a Linux kernel. Unmodified binaries are compiled to WebAssembly as they run, and a Linux-compatible layer in the runtime handles their system calls. CheerpX, the engine behind WebVM, runs 32-bit x86 Alpine this way.
  • Programs compiled to WebAssembly ahead of time. Programs are built for WebAssembly and run on a Linux-like kernel, and JavaScript runs on the browser's own engine. BrowserPod works this way.

The first release covers unkernel, CheerpX and BrowserPod. More runtimes, and tests that use the network, may follow: see Roadmap.

Results

Ratio to native: median of 3 runs, with the lowest and highest after it. Lower is faster.

Run on an Intel Core Ultra 7 268V (8 threads, 31 GiB of memory) with Linux 7.3.6 (Fedora 44), Chrome 158.0.8127.88 and podman 5.8.9. The raw results, with every run's time, the input hashes and the versions, are in results/2026-12-03T22-05-56-392Z.json.

Workload unkernel BrowserPod CheerpX
Command-line programs
shell-loop 22.3× 22.0–22.3 1.9× 1.9–1.9 5.3× 5.3–5.4
sort 11.3× 11.1–11.6 1.4× 1.4–1.4 4.6× 4.6–4.7
sha256sum 4.1× 4.1–4.2 1.7× 1.6–1.7 3.9× 3.9–3.9
gzip 10.0× 9.9–10.1 2.0× 2.0–2.0 3.6× 3.5–3.7
fs-walk 7.8× 7.7–8.5 5.8× 5.6–5.8 8.9× 8.8–8.9
Node.js programs
npm-ci 31.3× 30.9–31.9 9.6× 9.6–9.7 n/a
node-cpu 32.8× 28.5–34.8 5.1× 5.1–5.2 57.7× 54.5–67.6
acorn 48.5× 48.0–50.0 1.4× 1.4–1.5 32.3× 31.5–33.1
eslint 34.8× 34.7–35.7 2.3× 2.3–2.4 52.4× 52.1–53.9

How to read the results

Each cell is a workload's time on that runtime divided by native's median time for the same workload. 1.0× is as fast as native, and 4.0× takes four times as long, so lower is faster. The large number is the median of the runs' ratios, and the small numbers after it are the lowest and the highest. Native has no column: it is the base of every ratio, and its own times are in the raw results.

n/a means the runtime did not run that workload. The reason is under skip in config.json.

Compare the ratios, not the absolute times: those depend on the machine.

The runtimes

Native unkernel BrowserPod CheerpX
Version podman, alpine:3.24 by digest 0.3.0-261130-3ef745b 4.3.1, from its CDN 1.4.0, from its CDN
Runs x86_64 Alpine 3.24.4 on the host's CPU and kernel (a container, not a VM) arm64 Alpine 3.24.4 on an emulated CPU, Linux compiled to Wasm its own Wasm builds on a Linux-like kernel 32-bit x86 Alpine 3.22, JIT-compiled to Wasm
CPUs the host's 4, in a Web Worker (what its own page uses here; the SDK default is 1) its own 1
Network none no network device every request rejected none
Disk the container's distro image from the local server, writes in memory its own, fresh each boot ext2 image from the local server, writes in IndexedDB
BusyBox 1.37.0 1.37.0 1.36.1 1.37.0
Node 22.21.1 22.21.1 22.15.0 (its own) 22.23.5 (Alpine's)

The versions are kept as close as the builds allow. Node 22.21.1 is the closest Node 22 with musl builds for both x64 and arm64, since there is none of 22.15 for arm64. CheerpX has no 32-bit x86 build of 22.21, and Alpine 3.22 is the newest Alpine with an x86 Node 22.

The workloads

Every workload runs offline: no runtime has a network during the timed runs, and every input is copied in beforehand. Tests that use the network may follow: see Roadmap.

Workload Command
shell-loop while loop, 1,000,000 iterations
sort sort a 40 MB text file
sha256sum sha256sum a 50 MB file
gzip gzip -c the same 50 MB file
npm-ci npm ci --offline of the app: 170 packages from a local npm cache
node-cpu unkernel's cpu.js, 200 rounds: numbers, strings, JSON, a Map and a sort
fs-walk find over the app's node_modules (9,745 entries), 10 times
acorn acorn, the JavaScript parser under ESLint, parses react-dom's client build 30 times
eslint ESLint (recommended rules) on lodash.js

The first four are the tests techaiwire ran on unkernel, at TabBench's own sizes. node-cpu and fs-walk follow unkernel's own test/app-bench.sh and test/guest-bench.sh, on files that are the same on every runtime. The text files are generated from a fixed seed, so every machine gets the same bytes.

npm-ci, acorn, eslint and fs-walk use a small Node app (setup/npm-app) that comes with its node_modules (170 packages), installed by setup. npm-ci reinstalls the same packages with npm 10.9.2, BrowserPod's version and the same copy on every runtime, from an npm cache that setup fills. Its time includes npm ci deleting the existing node_modules.

How it measures

Each workload runs on a fresh instance of each runtime: a new container, or a new page that boots the runtime. Only that workload's inputs are copied in, plus native's and unkernel's own build of Node, and they are unpacked before timing starts. The workload is one command, run as busybox sh -c on every runtime: once to warm up, which is discarded, then 3 times (runs in config.json). Each run is divided by native's median, and the cell shows the median of those ratios with the lowest and highest.

Before timing, the harness checks the SHA-256 of every input on each runtime, so all of them do the same work. A run that exits with a code other than 0 stops that runtime, and the output of sha256sum and node-cpu is also checked against the expected hash and checksum.

A workload a runtime can't run is listed under skip in that runtime's options in config.json, with the reason. The table shows n/a. A runtime that fails is left out and the others still run, but without native there is no ratio table.

How fair is it?

  • Timing: native is timed inside the container to the microsecond (BusyBox adjtimex). The browser runtimes are timed on the page with performance.now() around the SDK call that runs the command.
  • Binaries: the programs are not the same binaries everywhere. BrowserPod runs its own Wasm build of Node, and the Node and BusyBox versions differ slightly (above).
  • CPUs: native uses all of the host's CPUs, unkernel 4 and CheerpX 1. Most workloads are single-threaded.

Limits

The runtimes run one after another on one machine, not interleaved. Boot time, download size and memory use are not measured yet.

Roadmap

TabBench aims to cover every Linux runtime that runs in a browser tab. The first release has three. Next:

More runtimes

Planned, each to be added once it runs the current workloads unmodified:

  • waarm64: a full arm64 machine emulated in WebAssembly, booting an unmodified Linux kernel.
  • v86: an x86 emulator that boots Linux in the browser.
  • JSLinux: Fabrice Bellard's x86 and RISC-V emulators.
  • container2wasm: containers converted to WebAssembly and run on an emulated CPU.
  • WebContainers: StackBlitz's Node.js runtime in the browser.

A runtime is added through a pull request with its target file (see Adding to it). Maintainers of other runtimes are welcome to send one, or to check the options their runtime runs with.

Tests with networking

The suite may be extended to tests that use the network. Each would reach one server on this machine, so no timed run depends on the internet. Candidates:

  • npm install: a real install from a local registry mirror, next to today's offline npm-ci.
  • Claude Code and Codex: each fixes a bug in a small Node project and runs its tests, against a local mock API that replays fixed model replies. That way TabBench measures the runtime, not the model's latency, and no API key is needed.
  • git-clone: a clone from a local git server.

Each runtime would reach the local server through its own network, so every runtime would need to boot with one, which none does today. CheerpX's only network is Tailscale, so whether it takes part is still open.

Running it yourself

You need a Linux x86_64 machine with Node 22+, podman, curl and Google Chrome.

npm run setup                   # once, with network: fills build/
npm run bench                   # all runtimes, about 20 minutes
npm run bench -- native unkernel   # or some of them

Each browser runtime runs in its own visible Chrome window; leave it open. Each run writes results/<date>.md, the ratio table, and results/<date>.json, with raw times, input hashes, versions and hardware.

Layout

bench.mjs        entry point
config.json      runs, the workloads (command and inputs), each target's options
targets/         one file per system: native.mjs, unkernel.js, browserpod.js, cheerpx.js; index.mjs lists them
lib/             shared harness: timing loop, Chrome driver, page, local server, report
setup/           setup.sh, the text-input generator, cpu.js, and npm-app/ (the app, with its tool configs)
build/           made by setup (not committed)
results/         made by bench (only the published run is committed)

Adding to it

  • Runtime: targets/<name>.js exporting boot(opts), put(name, bytes) and run(cmd), its options under targets in config.json, and a line in targets/index.mjs.
  • Workload: a cmd under sections in config.json, with the files it needs under its inputs and the group of rows it goes in. Workload names are unique. New input files are made in setup/. Every runtime boots without a network, so a workload that needs one also needs each runtime to boot with one.

Questions, or results from your own machine? Open an issue, or ask on the Leaning Technologies Discord.

Disclaimer

TabBench is maintained by Leaning Technologies, the company that makes BrowserPod and CheerpX / WebVM. Every command, input and setting is in this repository, so the results can be checked on any machine. Corrections from the makers of other runtimes are welcome.

About

Benchmark suite for Linux runtimes in the browser

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages