Skip to content

perf: Optimize app startup time by switching to PyInstaller one-folder mode#5

Merged
vhiroki merged 1 commit intomainfrom
optimize-startup-time
Dec 30, 2025
Merged

perf: Optimize app startup time by switching to PyInstaller one-folder mode#5
vhiroki merged 1 commit intomainfrom
optimize-startup-time

Conversation

@vhiroki
Copy link
Copy Markdown
Owner

@vhiroki vhiroki commented Dec 30, 2025

Problem

App startup was taking ~32 seconds due to PyInstaller one-file mode extracting the entire 80MB bundle to a temp directory on every launch.

Solution

Switch from PyInstaller one-file mode to one-folder mode, which eliminates the extraction step entirely.

Changes

  • build.spec: Changed to one-folder mode with COLLECT block
  • config.ts: Updated backend executable path for folder structure
  • build.py: Updated verification for new folder output
  • build-electron.sh: Updated paths for one-folder mode

Expected Results

  • Before: ~32 seconds startup (PyInstaller extraction)
  • After: ~2-5 seconds startup (no extraction needed)

Trade-offs

  • The installed app folder will have many files instead of one executable
  • The dist/qbox-backend/ folder must be copied as a complete unit

Testing

Rebuild and test with:

./build-electron.sh --make

- Change from one-file to one-folder mode in build.spec
- Update Electron config to look for executable in folder structure
- Update build.py to verify new folder output
- Update build-electron.sh paths for one-folder mode

This eliminates the ~30 second extraction delay on every app launch.
PyInstaller one-file mode extracts ~80MB to temp on each start.
One-folder mode keeps files ready to run immediately.
@vhiroki vhiroki merged commit b06094e into main Dec 30, 2025
1 check passed
@vhiroki vhiroki deleted the optimize-startup-time branch December 30, 2025 14:00
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