This is a backport PR for branch 42-x-y
MarshallOfSound

#51831: perf: backport startup performance improvements to 42-x-y (#51602, #51697, #51703)

Merged
Created: Jun 1, 2026, 6:20:28 PM
Merged: Jun 3, 2026, 1:22:49 AM
1 comments
Target: 42-x-y

Backport of #51602
Backport of #51697
Backport of #51703

Manual backport of three stacked startup-performance changes to 42-x-y (the same set that landed on 43-x-y via #51792), in a single PR:

  • #51602 — perf: push sandboxed renderer startup data via mojo and cache preload bytecode
  • #51697 — perf: build-time V8 code cache for the electron/js2c framework bundles
  • #51703 — perf: boot the browser process from an embedded Node startup snapshot

All three were originally labeled no-backport; this PR backports them deliberately on request. They are semver/patch (internal performance work, no public API change).

The first commit cherry-picks the squashed 43-x-y backport (ea8b0bb from #51792), which already includes the filenames.auto.gni regeneration and the patch re-contexting. Branch-specific adaptations:

  • New V8 patch (patches/v8/fastapi_store_v8_cfunction_pointer_directly_in.patch): 42-x-y pins Chromium 148 / V8 14.8, which stores fast-API CFunction overloads in non-serializable Managed<> objects, so run_node_mksnapshot (added by #51703) fails with CheckGlobalAndEternalHandles failed. This backports upstream V8 CL 7828135 ("[fastapi] Store v8::CFunction pointer directly in FunctionTemplateInfo", first shipped in V8 15.0.163 — already in 43-x-y's pinned V8, hence no patch needed there), which wraps the CFunction in a serializable Foreign instead. The only adaptation from upstream is keeping 14.8's GetCFunction(Isolate*, int) signature.
  • yarn.lock: the get-intrinsic resolutions pin from #51697 collapses the 1.2.1/1.2.4/1.3.0 split (this branch had three copies; 43-x-y had two) into a single 1.3.0 entry; verified canonical with yarn install --mode=update-lockfile (no drift).
  • script/run-clang-tidy.ts: re-resolved without the electron_smooth_round_rect.cc exclusion, which doesn't exist on this branch.
  • patches/{chromium,node}/.patches: dropped three 43-x-y-only entries that the 3-way merge incorrectly carried over.

The two new Chromium patches were pre-validated against Chromium 148.0.7778.218 with this branch's patch stack applied — both apply cleanly.

Notes: Improved app startup performance — the main process now boots from an embedded Node.js startup snapshot, framework bundles and preload scripts are cached as compiled V8 bytecode, and sandboxed renderer startup data is pushed ahead of navigation instead of fetched via blocking IPC. Preload stack traces now show the correct file path and line number.

Backport Information

Original PR Author
MarshallOfSound
Original PR Status
Merged
Original PR Merged At
May 19, 2026, 10:38:10 AM
Original PR Link
GitHubView on GitHub

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron