What was left of #3164 after a3232e3e1: with a 501-key and a 301-key
fold both open, WebKit drew the Routing page at ~17 frames a second.
The cause is one wire, not the 14k nodes. Hiding the rows, the 743
resting wires, the sky, setting content-visibility on the rows, or
skipping the viewBox write each changed nothing; hiding the one live
(dashed, flowing) wire, or only its dash, brought the frames back. A
fold hundreds of rows from magpie gets its wire as one cubic from the
hub to the fold, here 18,143 px tall. WebKit dashes a cubic at a cost
that grows faster than its length: a lone dashed cubic of 2,000 px is
free, 8,000 px ~24 ms a frame, 18,000 px ~75 ms; a straight line of any
length is free, and the same 18,000 px cubic cut into 8 exact pieces
draws at 60 fps. Chromium is fine either way.
curve() now cuts a wire's cubic (de Casteljau, even steps in t) into
pieces about 1000 px tall, at most 64. A wire under 1000 px gets the
same d as before. The pieces are the same curve: points at equal arc
length agree within 0.3 px (getPointAtLength's own error), total length
within 0.01 px, and the dash runs on across pieces of one subpath. Pixel
diffs of one cubic vs pieces, dashed, at three scrolls: Chromium 1-2k
pixels differ, none by more than 64/255 (antialias); WebKit the same,
plus 4, 181 and 15 pixels by more, where the long cubic's dashes were
unevenly spaced and the pieces' are even (dash phase; the dash flows). No row, wire, fold or style changed.
Measured: sandbox HOME, magpie -tags dev on its own ports, the same fake
upstream and keys as a3232e3e1 (501 + 301 keys, a request every 0.3 s),
1280x900, frames in 10 s, old and new alternated, twice each:
WebKit, folded old 580 / 568 new 567 / 568
WebKit, one open old 269 / 254 new 497 / 450
jank 5.6 / 5.8 s 2.1 / 2.7 s
WebKit, both open old 168 / 166 new 444 / 395
frames >50ms 140/144 5 / 6, jank 7.3 s -> 2.7 / 3.5 s
Chromium, all three old 596-601 new 595-601
routing-many-keys.test.cjs now also reads every wire's path: the
tallest wire must run over 5000 px and no cubic in any wire over
2000 px. Red 6 of 6 with origin/main's client.js (a cubic 27,753 /
27,228 px tall), green 6 of 6 with this one (1,484 / 1,456).
Run at this tree (origin/main a60493ab6 plus this; a60493ab6 touches
internal/gateway only, the runs below were at a3232e3e1 plus this):
- every internal/gui/tests/*routing*.test.cjs plus i18n-keys, both
engines: 1420 tests, 1365 pass, 55 red. The reds are the known
intent-entry #3408, live-patch #2174, manual #3409, pause #3410,
rule-effort #3411, rule-remove #3096 and steady #3412, plus
keys-fold (#1612, #2658), levels (filed #3620) and mode-goes
(#2151): each a 5 s wait timed out at load 23-34. Run alone they
pass both at origin/main and with this: keys-fold 32/32, levels
4/4, mode-goes 40/40.
- go test ./internal/gui -timeout 45m: red only in
TestRestartHandsTheGatewayOver (#3451, EOF during the handover under
load); alone -count 3, ok.
- GOOS=linux and GOOS=windows go vet -tags nogui ./...: clean. gofmt
-l: clean.
Not tried: the macOS app's own WKWebView window (Playwright's WebKit
here), and real upstream keys (fake upstream).