Skip to content

perf(electron): defer hidden-start renderer creation (3/8) - #10327

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.50from
backryun:perf/electron-lazy-hidden-renderer
Aug 20, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.50from
backryun:perf/electron-lazy-hidden-renderer

Conversation

@backryun

Copy link
Copy Markdown
Contributor

Part of #10321 (stage 3).

What changed

  • start the embedded/remote server and tray without constructing the dashboard BrowserWindow for --hidden, --minimized, and OS hidden-login launches
  • create the renderer only on an explicit Open OmniRoute action, tray double-click, second-instance launch, or macOS activation
  • restore/show/focus an existing renderer instead of creating duplicates
  • keep IPC, updater, remote-server prompt, and tray operation active without a renderer
  • keep hidden tray launches alive when their only auxiliary window closes

Measured impact

Comparable local macOS arm64 development runs used Electron 43.3.0, a fresh isolated user-data directory, --hidden, no running Next server, and an 8-second stabilization period. RSS is the complete Electron process tree.

  • before: 6 processes, 709.9 MiB RSS
  • after hidden/tray-only: 4 processes, 336.0 MiB RSS
  • reduction: 373.9 MiB (52.7%) in this development measurement
  • after explicit second-instance Open: 6 processes, 704.5 MiB RSS
  • remote-server hidden mode: 4 processes, 335.8 MiB RSS

These are local development measurements, not packaged-release guarantees. They show that the renderer is absent while hidden and created again on demand.

Validation

  • Electron-focused unit tests: 131 passed
  • npm run test:vitest: 357 passed
  • npm run check:file-size: passed
  • node syntax checks for electron/main.js and electron/lib/windowLifecycle.js: passed
  • live hidden launch, explicit second-instance open, and remote-server hidden launch: passed

The measurement-only electron/node_modules installation and isolated user-data directories were removed after the run.

@backryun
backryun requested a review from diegosouzapw as a code owner August 14, 2026 01:11
@backryun
backryun force-pushed the perf/electron-lazy-hidden-renderer branch 4 times, most recently from 54ba574 to ff4f686 Compare August 14, 2026 15:54
@backryun backryun changed the title perf(electron): defer hidden-start renderer creation perf(electron): defer hidden-start renderer creation (3/8) Aug 14, 2026
@backryun
backryun force-pushed the perf/electron-lazy-hidden-renderer branch 6 times, most recently from df63506 to 811244f Compare August 15, 2026 01:52
@backryun
backryun force-pushed the perf/electron-lazy-hidden-renderer branch 8 times, most recently from b0b8796 to 03d6ca5 Compare August 16, 2026 09:33
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Deferido para revalidação do head atual. A rodada anterior registrou um hold de ownership, mas a inspeção atual não confirmou esse worktree; por favor, reconfirme o head e os checks antes da decisão final.

@diegosouzapw diegosouzapw added the deferred-v3.8.50 Adiada para o ciclo v3.8.50 (validacao VPS, refactor, ou escopo grande) label Aug 17, 2026
@backryun
backryun force-pushed the perf/electron-lazy-hidden-renderer branch from 03d6ca5 to 2646c43 Compare August 17, 2026 08:51
@diegosouzapw diegosouzapw added the merge-train-deferred PR ejetada do merge-train — triagem separada label Aug 17, 2026
@backryun
backryun force-pushed the perf/electron-lazy-hidden-renderer branch 2 times, most recently from 8fc201a to 9d9a084 Compare August 17, 2026 17:42
@diegosouzapw diegosouzapw removed merge-train-deferred PR ejetada do merge-train — triagem separada deferred-v3.8.50 Adiada para o ciclo v3.8.50 (validacao VPS, refactor, ou escopo grande) labels Aug 17, 2026
@backryun
backryun force-pushed the perf/electron-lazy-hidden-renderer branch 11 times, most recently from fdee454 to 6534348 Compare August 20, 2026 13:23
@backryun
backryun force-pushed the perf/electron-lazy-hidden-renderer branch from 6534348 to 69e929a Compare August 20, 2026 13:39
@diegosouzapw
diegosouzapw merged commit 5e50814 into cheaper-inference:release/v3.8.50 Aug 20, 2026
5 checks passed
diegosouzapw pushed a commit that referenced this pull request Aug 20, 2026
Merged — locally validated (73/73 focused electron tests, typecheck:core clean, gates green) after resolving base-drift against #10327 (both landed today, real interleaved logic in createWindow/showMainWindow/window-all-closed — combined so the hidden-start lazy-open path from #10327 and the unload-on-close path from this PR both stay intact; verified by the existing test 'keeps the non-macOS app alive when unloading its last renderer'). Nice pair of electron perf PRs, thanks!
@backryun
backryun deleted the perf/electron-lazy-hidden-renderer branch August 20, 2026 14:35
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ce#10327)

Merged — locally validated (6/6 focused lazy-window tests, plus the wider electron suite, typecheck:core clean, gates green). Thanks!
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…ference#10328)

Merged — locally validated (73/73 focused electron tests, typecheck:core clean, gates green) after resolving base-drift against cheaper-inference#10327 (both landed today, real interleaved logic in createWindow/showMainWindow/window-all-closed — combined so the hidden-start lazy-open path from cheaper-inference#10327 and the unload-on-close path from this PR both stay intact; verified by the existing test 'keeps the non-macOS app alive when unloading its last renderer'). Nice pair of electron perf PRs, thanks!
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