Repository navigation
Conversation
The first window loads its renderer the moment it exists instead of after every layer, the shell mounts from settings handed over in the window's argv instead of waiting for the IPC port, the initial module graph ships as one chunk, and main defers the crash reporter, certificates, log cleanup and the onboarding scan off the path to the port. Window to shell on the packaged startup bench drops from ~680 ms to ~450 ms.
… the renderer The renderer speaks Effect's RPC wire format over the MessagePort directly: messages are structured clones, every payload is JSON-native or a Uint8Array, and the main process is trusted. That keeps Effect's runtime, Stream, Layer, RPC client and its timer-based fiber scheduler out of the renderer's initial module graph. Also adds a source-map attributed summary for renderer CPU profiles.
…render The preload asks the main process for the global, default and window state namespaces before the page runs; the answer comes from the database file until the storage layer is up, then from the layer so later windows see queued writes. The first render is the hydrated one: tabs are in the first frame instead of popping in after a round trip and a second layout pass. Window to shell on the packaged startup bench: ~424 ms to ~234 ms.
Member
Author
|
Split into a 7-PR stack, bottom at #50108 (stack #50115). Same final tree. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first window's renderer used to start only after every main-process layer had been built, then wait for the IPC port before it could show anything. It now boots alongside the main bundle and mounts its shell from state the main process already has.
createEarlyWindowregisters theoc://handler, permissions, navigation policy and headers itself and callsloadURLin the same tick the window is created. The entry chunk stays Effect-free; the protocol handler reports throughconsoleuntil the logging layer installs a reporter.codeSplitting.groupson everything statically reachable from the entry) instead of 47 files served one main-thread turn each.firstLaunchPendinganddefaultServerUrl; the preload asks main for theglobal,defaultand window state namespaces before the page runs (from the SQLite file until the storage layer is up, then from the layer so later windows see queued writes). The first render is the hydrated one — tabs are in the first frame, no re-render, no second layout pass.MessagePortdirectly (ipc-client.ts), keeping Effect's runtime,Stream,Layer, the RPC client and its timer-based fiber scheduler out of the renderer's initial module graph. Main is unchanged (RpcServer).crashReporter.start(~60 ms, spawns crashpad; now runs ~500 ms after the windows), async CLI resolve (now sync fs), eager theme palette resolution for both schemes, and a read-only background-service probe during main's idle window.Packaged startup bench (
bun run bench:startup), Windows laptop display, warm service, 5 interleaved runs, medians in ms since spawn:v2Window → shell: 664 → 210 ms. First pixels land ~50 ms later than before but as the complete hydrated frame; on stock Electron that instant is set by GPU shader compilation, which the renderer now finishes ahead of (electron/electron#54113 removes that wait).
Note: the crash reporter now starts after the first window is up, so a crash in roughly the first second of a launch is not reported.