gpboyer2 (#3731, v0.1.1579): with requests coming, the Routing page kept
redrawing, its stage, caption and request list jumping so nothing could
be read; idle it was still.
Measured on main 4a33cf0a9 with a probe (MutationObserver on
#view-routing, plus animationstart), 12 requests listed, then one still
going answered by the trace every 150ms, as under traffic:
- idle, 5s: 25 nodes put in and 25 taken out, 30 attribute writes. The
countdown's second ran rebuild(), and header() replaced the head's
nodes and wrote the mode line and each agent's name, sub and title
whatever they said.
- one live request, 5s (41 answers): 217 nodes in, 219 out, 824
attribute writes (nearly all the same value), and the row's rtlive
pulse started over 62 times. rowOf made the request's row again
whenever its signature changed, and a request still going changes it
on each answer (its tokens), so the row and its pulse came in afresh
4 to 8 times a second: the flashing.
Now rowOf patches the row it has (morphRow, as context.js's morph does
for the Context card), and the head, the agents' nodes, the wires'
viewBox, the list head's titles and aria (setAttr), the hub's title and
the packet's cx/cy are written only when they change. Same probe after:
idle 0 writes of any kind; one live request 0 nodes made again (2 taken
out: the packet's flight ending), 177 attribute writes, 0 pulse
restarts, in Chromium and WebKit.
Not changed: the stage still follows the newest request, so with
several agents at once it shows each in turn (by design; pinning a
request holds it), and the issue's "Pause live" switch and fixed stage
height (#2598) are not added here.
Test: tests/routing-live-calm.test.cjs. Idle three seconds the page
gets no write; with the live request answered again and again the row
is the same element, says the new tokens, its pulse never restarts and
no node is put in afresh. Green in chromium and webkit; with
client.js reverted to 4a33cf0a9 both red (rows made again, pulse
restarted).
Run (rt3731 worktree):
- At 4a33cf0a9 with this change: go test -timeout 45m ./internal/gui/
ok (176s). Rebased onto e9c1066c4 (no routing file changed between):
the same run red on TestRestartHandsTheGatewayOver only ("1 of 2
requests during the restart answered", #3451, the update handover);
run again with the budgets, -count=3: ok 3 of 3, TestCoreScriptBudget
ok. routing-live-calm.test.cjs at e9c1066c4: 2 of 2 ok.
- GUI tests/routing-*.test.cjs, whole, at this change and at 4a33cf0a9,
both cut at 1500s under load 100+: head 509 ok 4 red, base 462 ok 4
red; every red at head is routing-intent-entry's "Add a rule makes a
rule by intent" (#3408), red alone at both, different subtests each
time.
- 30 row, stage and head files alone at this change: 458 ok, 9 red:
routing-live-patch's folded subtests (an extra 0% context part, red
the same alone at 4a33cf0a9: 4 ok 6 red, #3637) and routing-keys-fold
"flies to the fold" in webkit zh/ja/de (#1612, #2658).