Skip to content

perf: lighter, faster Studio with the same scene - #177

Merged
egagofur merged 1 commit into
mainfrom
claude/studio-optimize-00e1a4
Nov 24, 2026
Merged

egagofur merged 1 commit into
mainfrom
claude/studio-optimize-00e1a4

Conversation

@egagofur

Copy link
Copy Markdown
Owner

Makes AEL Studio lighter and faster while keeping the same scene, look and interactions. Full report with before/after tables and side-by-side screenshots: docs/audit/studio-perf-2026-11.md.

Before / after (28-project fixture)

v3.0.0 this PR
First-load bytes 989,729 237,732
Reload bytes 989,729 ~7,000 (304)
First kitchen frame (median, n=11, interleaved) 1924 ms 1663 ms
/api/projects in page 93–124 ms 26–32 ms
One server poll (median) 68 ms 12 ms
Server CPU over 10 min 50.3 s 12.2 s
Draws / tris / programs per frame 267 / 229k / 28 unchanged

Changes

  • lib/studio/summary.js: each Run tree is walked once per summary. A plain entry under a realpath-checked run dir is in scope by construction. Every symlink still goes through contextPath. New test covers a nested escaping symlink and the single walk.
  • lib/studio-server.js: static files are served with an ETag and no-cache (304 on revalidate), plus brotli/gzip for files of 1 KiB or more, from an in-memory cache keyed by size and mtime. Auth runs before the cache check. API stays no-store.
  • studio/js/main.js: the kitchen module starts loading at boot, and the throwaway WebGL probe context is gone (if three cannot create a context, the page still falls back to the flat ring).
  • studio/js/forms.js: texture loops no longer allocate per pixel, and pixels are cached per session. The bytes match v3.0.0 (a test pins the hash).
  • studio/js/restaurant.js: renderer.debug.checkShaderErrors = false.

Measured and not kept

Texture workers made the first frame slower. An off-screen pause never fires because the layout never scrolls the kitchen out of view. The report also covers tree-shaking, merging, shadow gating and adaptive DPR, with the reasons each was dropped.

Parity

Pixel diffs at desktop and 375px, light and dark, including the zoomed station and the Details sheet: kitchen pixels are identical. The only changes are in the elapsed-time text, which crossed a minute boundary between captures.

Checks

npm test (907/907), npm run check:skills, npm run audit:package, npm run measure all green.

🤖 Generated with Claude Code

- Server: walk each Run tree once per poll; plain entries under a
  realpath-checked run dir are in scope by construction, every symlink
  still goes through contextPath. Poll with 28 projects 68 -> 12 ms,
  realpath/lstat 3266/1083 -> 398/127, idle server CPU ~4x lower.
- Static files: in-memory cache keyed by size+mtime, ETag with
  no-cache revalidation (304 on reload), brotli/gzip for files >= 1 KiB.
  First load 990 KB -> 238 KB, reload ~7 KB.
- Client: start loading the kitchen module at boot, drop the throwaway
  WebGL probe context (three's own failure path still falls back to the
  flat ring), allocation-free procedural texture loops with a per-session
  pixel cache (same bytes), skip shader info-log reads. First kitchen
  frame 1924 -> 1663 ms median.
- Report with before/after numbers and parity screenshots:
  docs/audit/studio-perf-2026-11.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@egagofur
egagofur merged commit 6f1097e into main Nov 24, 2026
10 checks passed
@egagofur egagofur mentioned this pull request Nov 24, 2026
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