Skip to content

perf: push preload paths to Node.js renderers instead of a sync IPC at startup - #53860

Merged
MarshallOfSound merged 1 commit into
mainfrom
perf/nonsandbox-startup-data
Sep 14, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
perf/nonsandbox-startup-data

Conversation

@MarshallOfSound

@MarshallOfSound MarshallOfSound commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Renderers with sandbox: false still fetched their preload list from browser-process JS with a synchronous BROWSER_NONSANDBOX_LOAD IPC during renderer init. The browser now pushes RendererStartupData to those frames as it already does for sandboxed ones (paths only, no file contents or environment), at frame creation and ahead of each committed navigation, and the sync IPC and its handler are removed.

Release build, Linux x64, median over 3 runs of 14 windows each:

sandbox: false window, first navigation, preload start before after
idle main process 66.9 ms 65.2 ms
main process busy (20 ms of every 25 ms) 82.3 ms 63.9 ms
sync IPCs during renderer init 1 0

Checklist

Release Notes

Notes: none

…t startup

Sandboxed frames already receive their preload list from the browser over the
ElectronFrameStartup channel ahead of CommitNavigation. Frames with Node.js
integration still blocked on a synchronous BROWSER_NONSANDBOX_LOAD round trip
into browser-process JS from renderer init to learn the same thing.

The browser now pushes RendererStartupData to those frames too, with only the
preload paths filled in (no file contents, environment or code cache, since
Node loads the files itself): at frame creation, so a script context created
on the initial empty document still sees it, and again ahead of each
committed navigation. ElectronRendererClient hands the paths to renderer
init and the sync IPC and its handler are removed.
@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 12, 2026
@MarshallOfSound
MarshallOfSound marked this pull request as ready for review September 13, 2026 21:25
@MarshallOfSound
MarshallOfSound requested a review from a team as a code owner September 13, 2026 21:25
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 14, 2026 18:09
@MarshallOfSound
MarshallOfSound merged commit a36f9cd into main Sep 14, 2026
100 checks passed
@MarshallOfSound
MarshallOfSound deleted the perf/nonsandbox-startup-data branch September 14, 2026 18:12
@release-clerk

release-clerk Bot commented Sep 14, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #53915

@trop

trop Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #53916

@trop trop Bot added in-flight/45-x-y merged/45-x-y PR was merged to the "45-x-y" branch. and removed target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. in-flight/45-x-y labels Sep 14, 2026
@trop

trop Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "43-x-y", please check out #53927

@trop trop Bot added merged/44-x-y PR was merged to the "44-x-y" branch. and removed in-flight/44-x-y labels Sep 15, 2026
MarshallOfSound added a commit that referenced this pull request Sep 15, 2026
…t startup (43-x-y) (#53927)

perf: push preload paths to Node.js renderers instead of a sync IPC at startup (#53860)

Sandboxed frames already receive their preload list from the browser over the
ElectronFrameStartup channel ahead of CommitNavigation. Frames with Node.js
integration still blocked on a synchronous BROWSER_NONSANDBOX_LOAD round trip
into browser-process JS from renderer init to learn the same thing.

The browser now pushes RendererStartupData to those frames too, with only the
preload paths filled in (no file contents, environment or code cache, since
Node loads the files itself): at frame creation, so a script context created
on the initial empty document still sees it, and again ahead of each
committed navigation. ElectronRendererClient hands the paths to renderer
init and the sync IPC and its handler are removed.

(cherry picked from commit a36f9cd)

43-x-y does not have ElectronBrowserClient::IsRendererProcessSandboxed(),
which renderer_startup_data::IsFrameInSandboxedRenderer() uses, so this
also carries that small helper (record whether each renderer process was
launched with --no-sandbox) from #52472.
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. and removed in-flight/43-x-y labels Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants