Benchmark in real Chromium too, and only call a row slower when the samples say so

npm run perf -- --browser times the same workloads in Chromium as a desktop
and as a phone (390x844 at 3x, CPU slowed 4x), one browser per version. Each
run collects garbage first and ends by forcing layout and the map canvas, so
deferred work counts. The jsdom DOM is about 30x slower than a browser's and
has no layout, so the interface rows need this.

Shared machines swing single runs by 30% on identical code, CPU time
included. A row now counts as slower or faster only when it moved 15% and a
Mann-Whitney U test gives p < 0.01 (15 runs a side by default). Identical
code: no flags in three full runs; a routing slowdown planted in a copy is
flagged in jsdom and on the phone.

The panel workload renders both selections every run instead of alternating,
which split its samples in two. CI drives the runner's Chrome through
playwright-core, no browser download.
This commit is contained in:
Frederic Jung 2026-10-26 12:04:57 +01:00
parent c88bad3eef
commit c76dd4d556
No known key found for this signature in database
11 changed files with 236 additions and 42 deletions

View file

@ -44,7 +44,8 @@ A tour of the code is in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
Releases are cut by the maintainer.
- Show the performance of changes to `site/` on a big network. The Performance check posts a table
comparing your PR with `main` as a comment; to run it yourself:
`git show origin/main:site/index.html > /tmp/base.html && npm run perf -- --base /tmp/base.html`.
`git show origin/main:site/index.html > /tmp/base.html && npm run perf -- --base /tmp/base.html`
(add `--browser` to also time it in Chromium as a desktop and a phone, like CI does).
Anything marked slower needs an explanation.
- Old saves must keep loading. New state needs a default for new games and a check in
`sanitize()`.