Skip to content

Time frames in a browser, and say how a host moves a departed person's proposals - #37

Merged
mgilardi merged 1 commit into
mainfrom
browser-benchmark
Nov 11, 2026
Merged

mgilardi merged 1 commit into
mainfrom
browser-benchmark

Conversation

@mgilardi

Copy link
Copy Markdown
Collaborator

Browser benchmark

The canvas renderer and the 1,000-node switch had only been timed in Node, which says nothing about painting or dropped frames.

  • apps/playground/bench.html (built with the playground) pans, zooms and scrolls made-up trees of 125 to 10,000 tips, as SVG and on the canvas, and times every frame. It runs in any browser: press Run, then save the numbers.
  • node scripts/bench-browser.mjs runs it in the Chrome already installed, headless, at pixel density 1 and 2 and with the main thread slowed 4 times, and writes docs/benchmarks-browser.md. --from <file> adds a section from numbers saved in another browser. It uses a throwaway profile that it deletes, listens on this machine only and sends nothing anywhere.

First numbers (headless Chrome 157, M2 Max, other work running, one run of each):

SVG kept 60 frames a second up to Canvas
Pixel density 1 and 2 1,999 nodes (about 30 a second at 4,999) every size, up to 19,999 nodes
Main thread slowed 4 times 499 nodes (58% of frames late at 999) every size, up to 19,999 nodes

The switch stays at 1,000 drawn nodes. The React README says it has room to spare on a fast machine, is a little high for a slow one, and suggests trying canvasThreshold={500} there.

Moving a departed person's proposals

A host asked how to move a departed person's accepted proposals to another account. Payload refuses any change to author and decidedBy, and that stays. The plugin README now says the lock is a hook, so a host makes the move in its own database code, changes only those two fields, and leaves proposal, checksum and the snapshot alone. A new test makes that move on MongoDB and checks that the proposal still matches its checksum, the version made from it still verifies, and the proposal stays locked. No plugin code changed. An option to allow the move through Payload was considered and not built; ADR 0012 says why.

Tested

  • pnpm build, pnpm typecheck, pnpm test (527 tests, one new), the leak check and the OneOrigin check pass locally.
  • The benchmark ran twice in full, under an hour apart, and agreed on which sizes kept up.

Not tested

  • The benchmark page and script have no tests of their own (docs/test-audit.md says why).
  • Nothing was measured in WebKit (Safari and the Mac app), Firefox, a window on a real screen, a real slow device, or radial layouts.
  • The new plugin test runs on MongoDB only.

🤖 Generated with Claude Code

…s proposals

The canvas renderer and the 1,000-node switch had only been timed in
Node, which says nothing about painting or dropped frames. A benchmark
page in the playground now pans, zooms and scrolls made-up trees as SVG
and on the canvas and times every frame, and a script runs it in
headless Chrome and writes docs/benchmarks-browser.md. First numbers,
from one machine with other work running: the canvas held 60 frames a
second at every size up to 19,999 nodes, also with the main thread
slowed 4 times; SVG held it through 1,999 nodes, and through 499 on the
slowed thread. The switch stays at 1,000. The README says what that
means for slow devices and what wasn't measured.

Separately, a host asked how to move a departed person's accepted
proposals to another account. Payload refuses any change to author and
decidedBy, and that stays. The README now says the lock is a hook, so
a host makes the move in its own database code, changing only those
two fields. A new test makes that move and checks the proposal and the
snapshot made from it still verify. An option to allow the move
through Payload was considered and not built; ADR 0012 says why.

Not tested: the benchmark page and script have no tests of their own.
Nothing was measured in WebKit, Firefox, a window on a real screen or
a real slow device. The new plugin test runs on MongoDB only.

Co-Authored-By: Claude <noreply@anthropic.com>
@mgilardi
mgilardi merged commit 273d91b into main Nov 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant