Web performance: light animation, gestures on a compositor layer, no forced layouts
Deploy web Studio / deploy (push) Successful in 3m46s

Measured with the new tools/bench_web.py on the web Studio's house demo, CPU slowed 6x:

- Idle: running CSS animations repainted the whole drawing every frame (99% of the main
  thread in a window). Animations now step on about ten times a second by default
  ("light", 5% idle); the new toolbar button switches light / smooth / off and the browser
  remembers it; [build] animation sets the default for built pages; view.animation().
  Pan and zoom gestures pause them. Status LEDs pause off-screen and with the rest now.
- Pan 28 -> 10 ms, zoom 69 -> 11 ms per step: gestures move the drawing as one compositor
  layer (transform) and set the viewBox once they end; --iso-k is set on the tags group
  only and only when it changes; the stage box is read once per frame.
- Hover 22 -> 15 ms per move: the tooltip is placed once per frame on its own layer and
  measured only when its text changes; the Studio's x/y readout updates ten times a second
  in a contained box; hover work in the Studio runs once per frame.
- Long object lists skip layout of rows out of sight (content-visibility).
- WASM built with opt-level 3: engine render 11.7 -> 9.4 ms for 10% more download.

Checks: Studio 102/102 (animation modes, pan as a layer, contained readout), web 87/87.
This commit is contained in:
grabowski committed 2026-10-24 20:46:35 +07:00
1 parent 19f4c83ae8
commit a202283a60
15 files changed
+476 -31

No files matched your search

+11 -1
View File
@@ -71,7 +71,7 @@ Each phase ends with tests, a Studio/viewer check in Edge, commit and push.
## Backlog (2026-10)
1. Web performance: the web build runs smoothly on low-power machines
1. ~~Web performance~~ (done, see below)
2. Conveyors: placeable conveyors
3. Producers with adjustable production speed
4. Robotic arms
@@ -88,6 +88,15 @@ multi-select (Ctrl+click on the map and in the list, Shift range, Shift+drag box
nudge, turn, copy, delete and property edits; a second click on a wall or fence selects the joined
run); the Pond with fish swimming round (`swim` primitive, CSS rotation), lily pads, ripples, reeds.
Web performance, measured with `tools/bench_web.py` on the web Studio's house demo with the CPU
slowed 6x (before → after): idle main thread in a browser window 99% → 5% (animations step about ten
times a second instead of repainting the drawing every frame; ▷ toolbar button: light / smooth / off,
`[build] animation`); zoom 69 → 11 ms per wheel step, pan 28 → 10 ms per move (gestures move the
drawing as one compositor layer and draw it again when they end; no forced layouts; `--iso-k` set on
the tags only); hover 22 → 15 ms per move (tooltip placed once per frame on its own layer, x/y
readout ten times a second); rotate 226 → 154 ms, edit 409 → 305 ms until painted (WASM built with
opt-level 3: engine render 11.7 → 9.4 ms at full speed).
## Phase 2: richer editing
- [x] Interior prefabs (see Build your own house); a building `rooms` prop is still open
@@ -116,4 +125,5 @@ run); the Pond with fish swimming round (`swim` primitive, CSS rotation), lily p
- [ ] `isokit check` rules from the QA checklist: props on paved areas, runs ending in the air,
covers drawn over their contents, tag overlaps
- [ ] Performance budget test (render ms per view, 60 fps pan) on a 3,500-node scene
(`tools/bench_web.py` measures it by hand for now)
- [ ] Packaged desktop app (Tauri); shared projects for the hosted web Studio (behind login)