diff --git a/CLAUDE.md b/CLAUDE.md index 60c9616..ce0f3b9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -77,6 +77,7 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl | `tools/wpt-mse.sh [outdir] [file ...]` | WPT media-source subset (60 files) in a hidden run; first run sparse-clones WPT at a pinned commit into `target/wpt` (needs internet once); prints subtest pass counts, results in `/wpt/results.json`; ~45 min | S027 | | `tools/smoke.sh tests/smoke/privacy-mode.txt` (+ `SMOKE_ARGS=--incognito … privacy-incognito.txt`) | privacy mode: `pages/fingerprint.html` read off/on, `fp-off.json`/`fp-on.json` + shots (offline); `privacy-net.txt` (needs `tests/smoke/net/server.py`) frame cookies, per-site pause, Accept-Language; `SMOKE_TIMEOUT=700 … coveryourtracks.txt` EFF's test off/on (internet, direct). Selftest `save ` writes a JS string result to `.json`; `SMOKE_ARGS` passes browser arguments | now (S024) | | `python tools/icons.py` | rebuilds the icon font subset and `src/ui/icons.rs` from `tools/icons.txt` (needs fontTools and Arch's ttf-material-symbols-variable) | now (S015) | +| `tools/engine-test/run.sh servo\|chromium\|webkit` + `analyze.py` | engine comparison: one browser visible on DP-1, throwaway profile, sites from `sites.txt`, per-second RAM (PSS), CPU, GPU of the whole process tree into `docs/engine/runs//samples.csv`; `webkit_shell.py` is the WebKitGTK 6.0 shell (needs `webkitgtk-6.0`); report `docs/engine/engine-comparison.md`. Never run two at once or alongside cargo | now | | appimagetool, wine + Inno Setup, VM "Windows 10" | packaging and Windows checks | see the user's global CLAUDE.md "Building" | Don't assume a tool exists: check first. When your plan creates a tool, add its row here. diff --git a/docs/engine/engine-comparison.md b/docs/engine/engine-comparison.md new file mode 100644 index 0000000..ef4920a --- /dev/null +++ b/docs/engine/engine-comparison.md @@ -0,0 +1,286 @@ +# Engine comparison: Servo vs WebKit vs Chromium (2026-11-12) + +The question: should Nacre stay on Servo, or switch engines? Three browsers loaded the same ten sites one by one on the +user's PC, visible on their screen, while a sampler recorded RAM, CPU and GPU every second. + +| | Browser | Engine | +|---|---|---| +| **Chromium** | old Python Nacre 0.2.1 (`~/.local/bin/nacre`, PyInstaller) | Qt WebEngine 6 = Chromium 140.0.7339 | +| **Servo** | Nacre (this repo, `main` at `ac5eeef`, MSE build) | Servo 0.7 | +| **WebKit** | `tools/engine-test/webkit_shell.py`, a bare GTK 4 window with one tab per page | WebKitGTK 6.0 2.54.2 | + +## Headline + +| All 10 tabs open | Chromium | Servo | WebKit | +|---|---|---|---| +| RAM (PSS of every process) | 3320 MB | **2010 MB** | 2990 MB | +| Empty browser at start | 556 MB | **139 MB** | 175 MB | +| CPU time for the whole run | 112 core-s | **62 core-s** | 61 core-s | +| Peak CPU | 254 % | **125 %** | 158 % | +| CPU at idle (60 s, all tabs) | 3.8 % | **1.0 %** | 4.4 % | +| VRAM | 434 MB | **209 MB** | 866 MB | +| Processes | 16 | 1 | 74 | +| Sites that work (of 10, judged against Chromium) | 9–10 | 6–7 | 5–6 (4 tabs blank, see caveats) | + +Servo uses about 40 % less RAM than Chromium with all ten tabs open, half the CPU time and half the VRAM. But some of +that saving comes from **pages it does not finish**: the YouTube video does not play and YouTube search shows no results. +On the sites that work in all three engines, Servo's RAM per tab is still lower than or equal to Chromium's (see +"Per site"). + +WebKit had **no clear RAM advantage** over Chromium (2990 vs 3320 MB). It used the most VRAM (866 MB, growing with every +tab) and 74 processes. In this minimal shell, four of its tabs stayed blank white. + +## Method + +- **Machine**: Arch Linux, 4 threads, 16 GB RAM, AMD RX 6400 (`card1`), niri on Wayland. Every browser ran on monitor + DP-1 (1600×900) in a maximized niri column, so every window was 1556×815. The real GPU was used, with each engine's + default acceleration. One browser ran at a time, and no cargo build was running. +- **Profiles**: each browser got a throwaway `HOME` and `XDG_*` folders under its run folder. WebKit also used an + ephemeral network session. No proxy, VPN or Tor was used. +- **Same pages in every engine**: ad blocking was **off** in both Nacres (WebKit has none). Tab freezing and unloading + were off in both Nacres, so all ten tabs stayed live. +- **Steps** (`tools/engine-test/sites.txt`): each site opened in a new tab and settled for 20 s (30 s for the watch + page). Then a page check ran (document state, element count, `