Skip to content

build: consume Electron-generated PGO profiles in release builds (42-x-y)#51828

Merged
MarshallOfSound merged 1 commit into
42-x-yfrom
sam/pgo-consumption-42-x-y
Jun 1, 2026
Merged

build: consume Electron-generated PGO profiles in release builds (42-x-y)#51828
MarshallOfSound merged 1 commit into
42-x-yfrom
sam/pgo-consumption-42-x-y

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Manual backport of #51815 to 42-x-y.

  • Wires 42-x-y release builds to consume the Electron-generated PGO profiles collected on this branch (run 26778371370: 8/8 platforms + V8 builtins, Chromium 148)
  • State files point at the 02044ed2bc-stamped profiles uploaded from that run
  • Identical mechanics to main: state files + gclient download hooks + a Chromium patch that resolves profiles through the standard chrome_pgo_phase = 2 machinery

Notes: Improved runtime performance.

Official release builds currently apply Chrome's published PGO profile.
PGO profiles match functions by symbol name and control-flow hash, so
every function that differs from Chrome - all of Node.js, patched
Chromium files, V8 built with Node's flags, and the Electron shell -
silently gets no optimization guidance and is laid out as cold. The same
applies to V8's builtins profile: Chrome's published profiles reject
Electron's promise/async builtins because the Node.js integration
changes their codegen.

This change points release builds at Electron-generated profiles served
from the build-tools storage account instead:

- build/pgo_profiles/<target>.pgo.txt state files name the profile each
  target consumes; updating profiles only changes these files.
- gclient hooks download the named profiles via
  script/pgo/download-profiles.py.
- A small Chromium patch teaches the standard chrome_pgo_phase = 2
  resolution to read Electron's state files (including per-arch Linux
  profiles, which upstream does not have). Keeping Chromium's own PGO
  configuration authoritative means every compiler and linker flag they
  maintain - -fprofile-use, warning suppressions, extended-TSP block
  layout, and anything they add in the future - applies to Electron's
  profiles unchanged. An explicitly set pgo_data_path still takes
  precedence as an override.
- Chrome's published profiles are no longer downloaded
  (checkout_pgo_profiles is now False).

chrome_pgo_phase already defaults to 2 for official builds, so a single
release.gn import works for every platform/arch with no per-platform
configuration.

Measured against Chrome's profiles (Linux x64, otherwise identical
builds): +9.5% on Speedometer 3.1, +16% geomean across 22 app-operation
benchmarks, with contextBridge calls +44-51%.
@MarshallOfSound MarshallOfSound requested review from a team as code owners June 1, 2026 21:51
@trop trop Bot added 42-x-y backport This is a backport PR labels Jun 1, 2026
@MarshallOfSound MarshallOfSound merged commit 6b2354f into 42-x-y Jun 1, 2026
69 of 71 checks passed
@MarshallOfSound MarshallOfSound deleted the sam/pgo-consumption-42-x-y branch June 1, 2026 23:04
@release-clerk

release-clerk Bot commented Jun 1, 2026

Copy link
Copy Markdown

Release Notes Persisted

Improved runtime performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants