Skip to content

Speed up BoxedWine application startup - #135

Draft
astrovm wants to merge 1 commit into
mainfrom
agent/boxedwine-fast-startup
Draft

Speed up BoxedWine application startup#135
astrovm wants to merge 1 commit into
mainfrom
agent/boxedwine-fast-startup

Conversation

@astrovm

@astrovm astrovm commented Aug 13, 2026

Copy link
Copy Markdown
Owner

What changed

  • Add startup stage measurements from runner load through the first native window.
  • Download the root filesystem, app package, overlays, and persistent storage state in parallel.
  • Keep the temporary D: drive in memory instead of mounting it in IndexedDB.
  • Rebuild BoxedWine with optional file-read tracing and deploy one reduced shared XP/Wine filesystem with preserved Unix metadata.
  • Preload the shared runtime after desktop login on capable devices. On constrained/mobile devices, preload only when the user opens Accessories or Games.
  • Content-hash the runner, WebAssembly, JavaScript, and shared filesystem. Exclude the original full root archive from production.

Measured startup improvement

Production builds of merged main and this PR ran on the same machine and in the same in-app Chromium session, on separate local origins. Each measurement starts at navigation and ends when BoxedWine logs Showing Window. Warm samples use independent tabs with browser assets already cached.

Scenario Samples main PR Improvement
Calculator, cold runtime 1 21.98 s 8.84 s 59.8% less time
Calculator, warm runtime 3 19.41 s average 8.47 s average 56.4% less time
FreeCell, warm runtime 3 19.76 s average 10.08 s average 49.0% less time

The local benchmark isolates initialization, decompression, compilation, and launch behavior. It does not predict internet transfer time. The shared archive is also 11.6% smaller, and the device-aware preload removes most runtime transfer from the user-triggered launch when it completes first.

Impact

The shared production filesystem is 43.6 MB instead of 49.3 MB. Startup work now overlaps, temporary per-app files avoid persistent-storage synchronization, and repeated app launches can use the browser cache. Calculator, FreeCell, Solitaire, and Spider Solitaire all use the same runtime path and shared root.

Validation

  • 128 automated tests pass.
  • Formatting, TypeScript, ESLint, browser JavaScript validation, and icon validation pass.
  • Production build validation passes.
  • In-app browser verification confirmed Calculator, FreeCell, Solitaire, and Spider Solitaire render from the optimized production archive on their native canvas sizes.
  • BoxedWine source hashes and the deterministic filesystem build were verified.

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