Skip to content

perf(desktop): unblock frontend assets and defer archive readers - #3915

Merged
bobleer merged 3 commits into
openBitFun:mainfrom
bobleer:bob/desktop-frontend-perf
Nov 14, 2026
Merged

bobleer merged 3 commits into
openBitFun:mainfrom
bobleer:bob/desktop-frontend-perf

Conversation

@bobleer

@bobleer bobleer commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Move packaged frontend file resolution off the WebView callback thread, load the appearance and visual-skin ZIP readers only when importing a package, and add an opt-out for native window material when comparing compositing cost.

Packaged hashed assets use content ETags with mandatory revalidation. Legacy customizations share these URLs, so long-lived immutable caching would serve stale scripts after preview, activation or rollback. Editable assets, bootstrap pages and failures retain no-store.

The related embedded Relay path now grants immutable caching only to successful hashed build assets (and their 304 responses). Unversioned files, HTML and missing chunks no longer receive a one-year cache lifetime.

Type and Areas

Type: performance improvement and regression prevention.

Areas: desktop/Tauri, Web UI appearance and visual-skin imports.

Motivation / Impact

Lazy chunk loads no longer perform filesystem reads and canonicalization on the WebView callback thread. Archive dependencies leave the initial loading path. OPENBITFUN_NATIVE_WINDOW_MATERIAL=0 selects the existing opaque fallback on macOS and Windows for controlled performance comparisons; normal behavior is unchanged.

Verification

All local checks passed on macOS:

  • pnpm run check:web and pnpm run build:web: type-check, appearance/theme gates, generated API bindings, Monaco assets and WebKit compatibility.
  • 107 focused frontend tests: AppearancePackageParser, ThemeTokenAppearanceAdapter, visual-skin archive/parser/runtime regressions, and startupPerformanceContract.
  • cargo test --locked -p openbitfun-desktop --no-default-features --lib frontend_: 37 tests, including legacy state, upgrades, controller-local/Peer admission and cache behavior. The 31 frontend_workbench tests were rerun after the final response-header correction.
  • cargo test --locked -p openbitfun-desktop --no-default-features --lib embedded_relay_host: 3 tests, including real loopback HTTP for mutable assets, hashed assets, 304s and 404s.
  • cargo test --locked -p openbitfun-desktop --no-default-features --lib window_material::tests: 4 tests, with both default settings and OPENBITFUN_NATIVE_WINDOW_MATERIAL=0; 2 appearance::startup_appearance_tests also passed.
  • cargo check --locked -p openbitfun-desktop --no-default-features --lib and cargo build --locked -p openbitfun-desktop --features devtools.
  • node tests/e2e/scripts/run-creation-runtime.mjs, with default material, OPENBITFUN_NATIVE_WINDOW_MATERIAL=0, and --suspended-paint: real packaged WebView loading, custom frontend activation, reload persistence and MiniApp create/open/render/update/delete all passed on the final build.
  • An additional native WebView probe checked GET/ETag/304/HEAD and a missing asset. The 2,137,345-byte entry chunk returned 304 with an empty body and the correct representation length; HEAD preserved that length and the 404 stayed no-store.
  • pnpm run fmt:rs, git diff --check, and node scripts/check-git-object-sizes.mjs --base upstream/main --head HEAD.

Production output confirms that JSZip and zip.js are dynamically imported chunks: 257,577 bytes total (101,679 bytes gzip). This measures deferred bundle bytes, not end-to-end startup latency.

Reviewer Notes

AI-assisted; testing level: fully tested for the stated local macOS scope. Cross-platform CI passed on commit 8bb93e31a: 11 checks succeeded and 2 impact-selected jobs were skipped. The CI workflow is successful. No persisted shape or wire protocol changes. Remote Control's embedded static HTTP path is covered by loopback fixtures; Peer/controller admission is covered by local fixtures. No live Remote Workspace, Remote Control device, Peer Device Mode or Detached Dispatch scenario was exercised. Native Windows/Linux rendering and end-to-end performance timing remain outside local verification.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 2b71f1a into openBitFun:main Nov 14, 2026
13 checks 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