Skip to content

perf: speed up web startup and reduce route and preview work - #584

Merged
davidmckayv merged 2 commits into
mainfrom
perf/startup-routes-previews
Sep 16, 2026
Merged

davidmckayv merged 2 commits into
mainfrom
perf/startup-routes-previews

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

Desktop launches rebuilt the web app every time, sign-in loaded the entire route bundle, and hidden computer previews kept processing images. This reuses valid builds, groups lazily loaded route components, and pauses hidden preview image work while retaining bot/control connections.

  • Build reuse invalidates on source, lockfile, version, Vite environment, and tenant inputs. Startup still regenerates tenant config before checking the cache; missing or invalid cache metadata rebuilds.
  • Route groups preserve existing lazy diagram/syntax imports. Dependencies remain under Rollup's normal chunking to avoid initialization cycles.
  • Hidden LiveScreen retains only the latest encoded frame and draws it on return, even without a new incoming frame. Screenshot previews pause offscreen/in hidden tabs; control polling continues.

Measured on macOS with Bun 1.3.14:

Check Result
Warm web-process startup 104 ms median, versus 10–12 seconds for a rebuild; three warm samples
Sign-in JavaScript 3,193,056 → 725,746 bytes; same-source production builds
Chat JavaScript 3,193,056 → 2,873,498 bytes, across 13 scripts; naive automatic splitting needed 78
Hidden previews 0 image decodes/draws/screenshot polls in two 15-second samples per component; controls and resume verified

Startup timing excludes desktop/Docker/API startup. Route measurements use controlled API responses and uncompressed loopback serving. LiveScreen retains its socket/network traffic while hidden. Separate real-backend validation used LangGraph to navigate Example.com, click through to IANA, and render a bar chart; the screenshot and successful tool results were inspected. The admin credentials route also rendered without JavaScript errors. Visual evidence is attached to FOR-310.

Validation: 837 tests passed, format, lint, explicit type checks (including startup scripts), production build, frozen lockfile install, and actionlint. Added macOS/Windows CI startup tests; Linux remains covered by the full CI suite. Real branding-change/reuse/default-restoration checks verified the compiled output.

Fixes FOR-310

@linear-code

linear-code Bot commented Sep 16, 2026

Copy link
Copy Markdown

FOR-310

@davidmckayv
davidmckayv merged commit a331c72 into main Sep 16, 2026
18 checks passed
@davidmckayv
davidmckayv deleted the perf/startup-routes-previews branch September 16, 2026 22:18
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.

2 participants