Skip to content

perf: boot every Node.js-hosting process from the Node snapshot / code cache - #52873

Merged
codebytere merged 1 commit into
mainfrom
pr/node-snapshot-all-node-processes
Aug 17, 2026
Merged

codebytere merged 1 commit into
mainfrom
pr/node-snapshot-all-node-processes

Conversation

@codebytere

@codebytere codebytere commented Aug 16, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Since #51703 the browser process boots from the embedded Node.js startup snapshot on native builds, but every other process that hosts Node.js - renderers with Node integration or an unsandboxed preload, Node-enabled web workers, the utility-process node service, and ELECTRON_RUN_AS_NODE / child_process.fork() children - still ran the full bootstrap, compiling the ~120-140 builtins it loads from source on every start (and then serializing a fresh code cache for each of them that nothing ever consumed: NODE_DEBUG_NATIVE=CODE_CACHE in a forked child prints 124× "Compiling … without code cache").

Three pieces:

  1. Build-time code cache for Node's own builtins in every process flavor. electron_natives_codecache now also emits a V8 code cache for Node's lib/ builtins (everything but internal/deps/*, which nothing loads during startup) for the flavors whose processes bootstrap Node from scratch, compiled against that flavor's isolate and flag set exactly like the electron/js2c/* bundles already were. The cache has to be in place before node::NewContext / node::CreateEnvironment run the bootstrap - i.e. before we can reach env->builtin_loader() - so it is installed as a process-wide default that every BuiltinLoader is seeded with (small new BuiltinLoader::SetProcessDefaultCodeCache() hook in the existing js2c code-cache node patch), from JavascriptEnvironment, NodeBindings::Initialize and the web-worker path. GN decides per flavor whether Node's builtins are embedded (always for the renderer flavor; utility/browser only on builds without a Node snapshot), so native builds carry one copy.
  2. ELECTRON_RUN_AS_NODE children and the utility-process node service create their isolate from the embedded Node snapshot too. Each has exactly one JavascriptEnvironment isolate (worker threads inherit the snapshot through IsolateData), so JavascriptEnvironment hands them the snapshot like it does for the browser process, CreateIsolateData gets its EmbedderSnapshotData, CreateEnvironment an empty context, the deserialized context is entered, and the duplicate per-isolate message listener the snapshot path already installed is skipped. Cross builds and custom-V8-snapshot setups keep the from-scratch path. The js2c cache flavor now follows what the isolate was actually created from (ELECTRON_RUN_AS_NODE children were previously fed the browser flavor, keyed to the Node-snapshot isolate, so even their node_init cache was silently rejected).
  3. A node_platform.cc fix that (2) exposed. WorkerThreadsTaskRunner::DelayedTaskScheduler drains its queue through a TaskQueue, which is a std::priority_queue treating plain v8::Tasks as equal, so a StopTask can run before an earlier-queued ScheduleTask; that then arms a timer on the stopped loop and NodePlatform::Shutdown() waits it out - observed as ~10 % of forked children stalling for exactly 8 s (V8's memory-reducer delay) at exit in release builds. New small patch drops ScheduleTasks that arrive after StopTask; I'll send it upstream as well.

Whether a process may use the Node snapshot is now decided only by comparing the blob it loaded against the built-in one (#52872), so the LoadBrowserProcessSpecificV8Snapshot fuse affects just the browser process, whose blob it swaps.

Tests: the DCHECK-only cache-status record now covers all builtins, and spec/api-js2c-code-cache-spec.ts asserts that browser / renderer / utility / run-as-node compile no Node builtin without consuming a cache entry, once as built and once from a copy of the app with the LoadBrowserProcessSpecificV8Snapshot fuse on. node-spec, utility-process, net, modules, asar, esm, context-bridge and ipc-renderer specs pass locally.

Linux x64 release build (official, ThinLTO, PGO), interleaved A/B against main, n=40 fresh processes per cell:

main this PR
ELECTRON_RUN_AS_NODE=1 electron -e 0 (spawn → exit) 82.5 ms 37.0 ms
child_process.fork(noop) → 'exit' 89.4 ms 41.1 ms
utilityProcess.fork() → first message 86.1 ms 39.7 ms
nodeIntegration renderer, timeOrigin → first preload statement 90.9 ms 64.7 ms
stripped binary +2.0 MB

(The +2.0 MB is the renderer flavor's cache for Node's builtins; a testing/dcheck build shows +6.4 MB because the caches serialize ~3.5× larger there.)

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • tests are changed or added

Release Notes

Notes: Improved startup time of utilityProcess.fork(), child_process.fork() / ELECTRON_RUN_AS_NODE child processes and Node.js-enabled renderers.

@codebytere
codebytere requested a review from a team as a code owner August 16, 2026 21:11
@codebytere codebytere added the semver/patch backwards-compatible bug fixes label Aug 16, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 16, 2026
Base automatically changed from pr/custom-v8-snapshot-main-process to main August 17, 2026 00:34
@MarshallOfSound
MarshallOfSound force-pushed the pr/node-snapshot-all-node-processes branch from 42709d8 to 204d28a Compare August 17, 2026 00:34

@MarshallOfSound MarshallOfSound left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One real issue in LoadedV8SnapshotIsBuiltIn, everything else looks right to me. The fuse shortcut is now load-bearing for the utility process and it gets the answer wrong there, which quietly undoes this PR for anyone shipping with LoadBrowserProcessSpecificV8Snapshot on. Fix is a one-liner, would be good to get a fuse-flipped case into api-js2c-code-cache-spec.ts too so it stays fixed.

Comment thread shell/browser/javascript_environment.cc Resolved
@codebytere
codebytere force-pushed the pr/node-snapshot-all-node-processes branch 2 times, most recently from 221c514 to 2ec0533 Compare August 17, 2026 05:27
@codebytere
codebytere force-pushed the pr/node-snapshot-all-node-processes branch from 2ec0533 to 0343dbd Compare August 17, 2026 06:20
…e cache

Since #51703 the browser process boots from the embedded Node.js startup
snapshot on native builds, but every other process that hosts Node.js --
renderers with Node integration or an unsandboxed preload, Node-enabled
web workers, the utility-process node service, and ELECTRON_RUN_AS_NODE /
child_process.fork() children -- still ran the full bootstrap, compiling
the ~120-140 builtins it loads from source on every start (and then
serializing a fresh code cache for each of them that nothing consumed).

Three pieces:

1. Build-time code cache for Node's own builtins in every process flavor.
   The electron_natives_codecache tool now also emits a V8 code cache for
   Node's lib/ builtins (all but internal/deps/*) for the flavors whose
   processes bootstrap Node from scratch, compiled against that flavor's
   isolate and flag set like the electron/js2c/* bundles already were.
   The cache has to be in place before node::NewContext and
   node::CreateEnvironment run the bootstrap, i.e. before Electron can
   reach env->builtin_loader(), so it is installed as a process-wide
   default every BuiltinLoader is seeded with (new
   BuiltinLoader::SetProcessDefaultCodeCache() hook in the js2c code-cache
   node patch), from JavascriptEnvironment / NodeBindings::Initialize /
   the web-worker path. GN decides per flavor whether Node's builtins are
   embedded (always for the renderer flavor; utility/browser only on
   builds without a Node snapshot), so native builds pay for one copy.

2. ELECTRON_RUN_AS_NODE children and the utility-process node service
   create their isolate from the embedded Node snapshot too. Each has
   exactly one JavascriptEnvironment isolate (worker threads inherit the
   snapshot through IsolateData), so JavascriptEnvironment hands them the
   snapshot like the browser process, CreateIsolateData gets its
   EmbedderSnapshotData, CreateEnvironment an empty context, the
   deserialized context is entered, and the duplicate per-isolate message
   listener the snapshot path already installed is skipped. Cross builds
   and custom-V8-snapshot setups keep the from-scratch path. The js2c
   cache flavor now follows what the isolate was actually created from
   (ELECTRON_RUN_AS_NODE children were previously fed the browser flavor
   keyed to the Node-snapshot isolate, so even their node_init cache was
   silently rejected).

3. A node_platform fix this exposed: WorkerThreadsTaskRunner's
   DelayedTaskScheduler drains its queue through a TaskQueue, which is a
   std::priority_queue treating plain v8::Tasks as equal, so a StopTask
   can run before an earlier-queued ScheduleTask; that then arms a timer
   on the stopped loop and NodePlatform::Shutdown() waits it out --
   observed as ~10 % of forked children stalling exactly 8 s (V8's
   memory-reducer delay) at exit in release builds. New patch drops
   ScheduleTasks that arrive after StopTask; upstreamable.

The DCHECK-only cache-status record now covers all builtins, and the
js2c code-cache spec asserts that browser / renderer / utility /
run-as-node compile no Node builtin without consuming a cache entry,
once as built and once from a copy of the app with the
LoadBrowserProcessSpecificV8Snapshot fuse enabled. Whether a process may
use the Node snapshot is decided by comparing the blob it loaded with the
built-in one alone, so the fuse only affects the process whose blob it
actually swaps.
spec/node-spec.ts, utility-process, net, modules, asar, esm,
context-bridge, ipc-renderer specs pass locally.

Linux x64 release build (official, ThinLTO, PGO), interleaved A/B vs
main, n=40 fresh processes per cell:
  ELECTRON_RUN_AS_NODE=1 electron -e 0     82.5 -> 37.0 ms
  child_process.fork(noop) -> 'exit'       89.4 -> 41.1 ms
  utilityProcess.fork -> first message     86.1 -> 39.7 ms
  nodeIntegration renderer, timeOrigin ->
    first preload statement                90.9 -> 64.7 ms
  stripped binary                          +2.0 MB
@codebytere
codebytere force-pushed the pr/node-snapshot-all-node-processes branch from 0343dbd to 50b484a Compare August 17, 2026 16:20
@codebytere
codebytere requested a review from deepak1556 August 17, 2026 17:47
@codebytere codebytere added target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. labels Aug 17, 2026
@codebytere
codebytere merged commit a77b899 into main Aug 17, 2026
94 checks passed
@codebytere
codebytere deleted the pr/node-snapshot-all-node-processes branch August 17, 2026 20:04
@release-clerk

release-clerk Bot commented Aug 17, 2026

Copy link
Copy Markdown

Release Notes Persisted

Improved startup time of utilityProcess.fork(), child_process.fork() / ELECTRON_RUN_AS_NODE child processes and Node.js-enabled renderers.

@trop

trop Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "43-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot removed the target/43-x-y PR should also be added to the "43-x-y" branch. label Aug 17, 2026
@trop

trop Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "42-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/43-x-y and removed target/42-x-y PR should also be added to the "42-x-y" branch. labels Aug 17, 2026
@trop

trop Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "44-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/42-x-y needs-manual-bp/44-x-y and removed target/44-x-y PR should also be added to the "44-x-y" branch. labels Aug 17, 2026
@trop

trop Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

@codebytere has manually backported this PR to "44-x-y", please check out #53134

@trop

trop Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

@codebytere has manually backported this PR to "42-x-y", please check out #53136

codebytere added a commit that referenced this pull request Aug 23, 2026
https://chromium-review.googlesource.com/c/v8/v8/+/8188320

ScriptCompiler::CreateCodeCache() on a script whose source is an
external string left that string with a null resource_data_ handle
under V8_ENABLE_SANDBOX, so the next String.prototype.startsWith() /
indexOf() on it aborted in LoadExternalPointerFromObject(). Node's
builtin sources are external strings and #52873 has every Node.js
process consume or produce a code cache for them; main picked the fix
up with the 153.0.8001.0 roll.
codebytere added a commit that referenced this pull request Aug 23, 2026
https://chromium-review.googlesource.com/c/v8/v8/+/8188320

ScriptCompiler::CreateCodeCache() on a script whose source is an
external string left that string with a null resource_data_ handle
under V8_ENABLE_SANDBOX, so the next String.prototype.startsWith() /
indexOf() on it aborted in LoadExternalPointerFromObject(). Node's
builtin sources are external strings and #52873 has every Node.js
process consume or produce a code cache for them; main picked the fix
up with the 153.0.8001.0 roll.
codebytere added a commit that referenced this pull request Aug 23, 2026
https://chromium-review.googlesource.com/c/v8/v8/+/8188320

ScriptCompiler::CreateCodeCache() on a script whose source is an
external string left that string with a null resource_data_ handle
under V8_ENABLE_SANDBOX, so the next String.prototype.startsWith() /
indexOf() on it aborted in LoadExternalPointerFromObject(). Node's
builtin sources are external strings and #52873 has every Node.js
process consume or produce a code cache for them; main picked the fix
up with the 153.0.8001.0 roll.
codebytere added a commit that referenced this pull request Aug 23, 2026
…e cache (#53134)

perf: boot every Node.js-hosting process from the Node snapshot / code cache (#52873)

Since #51703 the browser process boots from the embedded Node.js startup
snapshot on native builds, but every other process that hosts Node.js --
renderers with Node integration or an unsandboxed preload, Node-enabled
web workers, the utility-process node service, and ELECTRON_RUN_AS_NODE /
child_process.fork() children -- still ran the full bootstrap, compiling
the ~120-140 builtins it loads from source on every start (and then
serializing a fresh code cache for each of them that nothing consumed).

Three pieces:

1. Build-time code cache for Node's own builtins in every process flavor.
   The electron_natives_codecache tool now also emits a V8 code cache for
   Node's lib/ builtins (all but internal/deps/*) for the flavors whose
   processes bootstrap Node from scratch, compiled against that flavor's
   isolate and flag set like the electron/js2c/* bundles already were.
   The cache has to be in place before node::NewContext and
   node::CreateEnvironment run the bootstrap, i.e. before Electron can
   reach env->builtin_loader(), so it is installed as a process-wide
   default every BuiltinLoader is seeded with (new
   BuiltinLoader::SetProcessDefaultCodeCache() hook in the js2c code-cache
   node patch), from JavascriptEnvironment / NodeBindings::Initialize /
   the web-worker path. GN decides per flavor whether Node's builtins are
   embedded (always for the renderer flavor; utility/browser only on
   builds without a Node snapshot), so native builds pay for one copy.

2. ELECTRON_RUN_AS_NODE children and the utility-process node service
   create their isolate from the embedded Node snapshot too. Each has
   exactly one JavascriptEnvironment isolate (worker threads inherit the
   snapshot through IsolateData), so JavascriptEnvironment hands them the
   snapshot like the browser process, CreateIsolateData gets its
   EmbedderSnapshotData, CreateEnvironment an empty context, the
   deserialized context is entered, and the duplicate per-isolate message
   listener the snapshot path already installed is skipped. Cross builds
   and custom-V8-snapshot setups keep the from-scratch path. The js2c
   cache flavor now follows what the isolate was actually created from
   (ELECTRON_RUN_AS_NODE children were previously fed the browser flavor
   keyed to the Node-snapshot isolate, so even their node_init cache was
   silently rejected).

3. A node_platform fix this exposed: WorkerThreadsTaskRunner's
   DelayedTaskScheduler drains its queue through a TaskQueue, which is a
   std::priority_queue treating plain v8::Tasks as equal, so a StopTask
   can run before an earlier-queued ScheduleTask; that then arms a timer
   on the stopped loop and NodePlatform::Shutdown() waits it out --
   observed as ~10 % of forked children stalling exactly 8 s (V8's
   memory-reducer delay) at exit in release builds. New patch drops
   ScheduleTasks that arrive after StopTask; upstreamable.

The DCHECK-only cache-status record now covers all builtins, and the
js2c code-cache spec asserts that browser / renderer / utility /
run-as-node compile no Node builtin without consuming a cache entry,
once as built and once from a copy of the app with the
LoadBrowserProcessSpecificV8Snapshot fuse enabled. Whether a process may
use the Node snapshot is decided by comparing the blob it loaded with the
built-in one alone, so the fuse only affects the process whose blob it
actually swaps.
spec/node-spec.ts, utility-process, net, modules, asar, esm,
context-bridge, ipc-renderer specs pass locally.

Linux x64 release build (official, ThinLTO, PGO), interleaved A/B vs
main, n=40 fresh processes per cell:
  ELECTRON_RUN_AS_NODE=1 electron -e 0     82.5 -> 37.0 ms
  child_process.fork(noop) -> 'exit'       89.4 -> 41.1 ms
  utilityProcess.fork -> first message     86.1 -> 39.7 ms
  nodeIntegration renderer, timeOrigin ->
    first preload statement                90.9 -> 64.7 ms
  stripped binary                          +2.0 MB

(cherry picked from commit a77b899)
@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 Aug 23, 2026
codebytere added a commit that referenced this pull request Aug 23, 2026
…e cache (#53135)

perf: boot every Node.js-hosting process from the Node snapshot / code cache (#52873)

Since #51703 the browser process boots from the embedded Node.js startup
snapshot on native builds, but every other process that hosts Node.js --
renderers with Node integration or an unsandboxed preload, Node-enabled
web workers, the utility-process node service, and ELECTRON_RUN_AS_NODE /
child_process.fork() children -- still ran the full bootstrap, compiling
the ~120-140 builtins it loads from source on every start (and then
serializing a fresh code cache for each of them that nothing consumed).

Three pieces:

1. Build-time code cache for Node's own builtins in every process flavor.
   The electron_natives_codecache tool now also emits a V8 code cache for
   Node's lib/ builtins (all but internal/deps/*) for the flavors whose
   processes bootstrap Node from scratch, compiled against that flavor's
   isolate and flag set like the electron/js2c/* bundles already were.
   The cache has to be in place before node::NewContext and
   node::CreateEnvironment run the bootstrap, i.e. before Electron can
   reach env->builtin_loader(), so it is installed as a process-wide
   default every BuiltinLoader is seeded with (new
   BuiltinLoader::SetProcessDefaultCodeCache() hook in the js2c code-cache
   node patch), from JavascriptEnvironment / NodeBindings::Initialize /
   the web-worker path. GN decides per flavor whether Node's builtins are
   embedded (always for the renderer flavor; utility/browser only on
   builds without a Node snapshot), so native builds pay for one copy.

2. ELECTRON_RUN_AS_NODE children and the utility-process node service
   create their isolate from the embedded Node snapshot too. Each has
   exactly one JavascriptEnvironment isolate (worker threads inherit the
   snapshot through IsolateData), so JavascriptEnvironment hands them the
   snapshot like the browser process, CreateIsolateData gets its
   EmbedderSnapshotData, CreateEnvironment an empty context, the
   deserialized context is entered, and the duplicate per-isolate message
   listener the snapshot path already installed is skipped. Cross builds
   and custom-V8-snapshot setups keep the from-scratch path. The js2c
   cache flavor now follows what the isolate was actually created from
   (ELECTRON_RUN_AS_NODE children were previously fed the browser flavor
   keyed to the Node-snapshot isolate, so even their node_init cache was
   silently rejected).

3. A node_platform fix this exposed: WorkerThreadsTaskRunner's
   DelayedTaskScheduler drains its queue through a TaskQueue, which is a
   std::priority_queue treating plain v8::Tasks as equal, so a StopTask
   can run before an earlier-queued ScheduleTask; that then arms a timer
   on the stopped loop and NodePlatform::Shutdown() waits it out --
   observed as ~10 % of forked children stalling exactly 8 s (V8's
   memory-reducer delay) at exit in release builds. New patch drops
   ScheduleTasks that arrive after StopTask; upstreamable.

The DCHECK-only cache-status record now covers all builtins, and the
js2c code-cache spec asserts that browser / renderer / utility /
run-as-node compile no Node builtin without consuming a cache entry,
once as built and once from a copy of the app with the
LoadBrowserProcessSpecificV8Snapshot fuse enabled. Whether a process may
use the Node snapshot is decided by comparing the blob it loaded with the
built-in one alone, so the fuse only affects the process whose blob it
actually swaps.
spec/node-spec.ts, utility-process, net, modules, asar, esm,
context-bridge, ipc-renderer specs pass locally.

Linux x64 release build (official, ThinLTO, PGO), interleaved A/B vs
main, n=40 fresh processes per cell:
  ELECTRON_RUN_AS_NODE=1 electron -e 0     82.5 -> 37.0 ms
  child_process.fork(noop) -> 'exit'       89.4 -> 41.1 ms
  utilityProcess.fork -> first message     86.1 -> 39.7 ms
  nodeIntegration renderer, timeOrigin ->
    first preload statement                90.9 -> 64.7 ms
  stripped binary                          +2.0 MB

(cherry picked from commit a77b899)
@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 Aug 23, 2026
codebytere added a commit that referenced this pull request Aug 23, 2026
…e cache (#53136)

perf: boot every Node.js-hosting process from the Node snapshot / code cache (#52873)

Since #51703 the browser process boots from the embedded Node.js startup
snapshot on native builds, but every other process that hosts Node.js --
renderers with Node integration or an unsandboxed preload, Node-enabled
web workers, the utility-process node service, and ELECTRON_RUN_AS_NODE /
child_process.fork() children -- still ran the full bootstrap, compiling
the ~120-140 builtins it loads from source on every start (and then
serializing a fresh code cache for each of them that nothing consumed).

Three pieces:

1. Build-time code cache for Node's own builtins in every process flavor.
   The electron_natives_codecache tool now also emits a V8 code cache for
   Node's lib/ builtins (all but internal/deps/*) for the flavors whose
   processes bootstrap Node from scratch, compiled against that flavor's
   isolate and flag set like the electron/js2c/* bundles already were.
   The cache has to be in place before node::NewContext and
   node::CreateEnvironment run the bootstrap, i.e. before Electron can
   reach env->builtin_loader(), so it is installed as a process-wide
   default every BuiltinLoader is seeded with (new
   BuiltinLoader::SetProcessDefaultCodeCache() hook in the js2c code-cache
   node patch), from JavascriptEnvironment / NodeBindings::Initialize /
   the web-worker path. GN decides per flavor whether Node's builtins are
   embedded (always for the renderer flavor; utility/browser only on
   builds without a Node snapshot), so native builds pay for one copy.

2. ELECTRON_RUN_AS_NODE children and the utility-process node service
   create their isolate from the embedded Node snapshot too. Each has
   exactly one JavascriptEnvironment isolate (worker threads inherit the
   snapshot through IsolateData), so JavascriptEnvironment hands them the
   snapshot like the browser process, CreateIsolateData gets its
   EmbedderSnapshotData, CreateEnvironment an empty context, the
   deserialized context is entered, and the duplicate per-isolate message
   listener the snapshot path already installed is skipped. Cross builds
   and custom-V8-snapshot setups keep the from-scratch path. The js2c
   cache flavor now follows what the isolate was actually created from
   (ELECTRON_RUN_AS_NODE children were previously fed the browser flavor
   keyed to the Node-snapshot isolate, so even their node_init cache was
   silently rejected).

3. A node_platform fix this exposed: WorkerThreadsTaskRunner's
   DelayedTaskScheduler drains its queue through a TaskQueue, which is a
   std::priority_queue treating plain v8::Tasks as equal, so a StopTask
   can run before an earlier-queued ScheduleTask; that then arms a timer
   on the stopped loop and NodePlatform::Shutdown() waits it out --
   observed as ~10 % of forked children stalling exactly 8 s (V8's
   memory-reducer delay) at exit in release builds. New patch drops
   ScheduleTasks that arrive after StopTask; upstreamable.

The DCHECK-only cache-status record now covers all builtins, and the
js2c code-cache spec asserts that browser / renderer / utility /
run-as-node compile no Node builtin without consuming a cache entry,
once as built and once from a copy of the app with the
LoadBrowserProcessSpecificV8Snapshot fuse enabled. Whether a process may
use the Node snapshot is decided by comparing the blob it loaded with the
built-in one alone, so the fuse only affects the process whose blob it
actually swaps.
spec/node-spec.ts, utility-process, net, modules, asar, esm,
context-bridge, ipc-renderer specs pass locally.

Linux x64 release build (official, ThinLTO, PGO), interleaved A/B vs
main, n=40 fresh processes per cell:
  ELECTRON_RUN_AS_NODE=1 electron -e 0     82.5 -> 37.0 ms
  child_process.fork(noop) -> 'exit'       89.4 -> 41.1 ms
  utilityProcess.fork -> first message     86.1 -> 39.7 ms
  nodeIntegration renderer, timeOrigin ->
    first preload statement                90.9 -> 64.7 ms
  stripped binary                          +2.0 MB

(cherry picked from commit a77b899)
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

45-x-y merged/42-x-y PR was merged to the "42-x-y" branch. 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. new-pr 🌱 PR opened recently semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants