Skip to content

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

Merged
jkleinsc merged 1 commit into
43-x-yfrom
sam/pgo-consumption-43-x-y
Jun 3, 2026
Merged

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

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

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

  • Wires 43-x-y release builds to consume the Electron-generated PGO profiles collected on this branch (run 26778369197: 8/8 platforms + V8 builtins, Chromium 150)
  • State files point at the 4261f685ba-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.

@MarshallOfSound MarshallOfSound requested review from a team as code owners June 1, 2026 21:56
@trop trop Bot added 43-x-y backport This is a backport PR labels Jun 1, 2026
@MarshallOfSound MarshallOfSound force-pushed the sam/pgo-consumption-43-x-y branch from 30955ba to 5b339fd Compare June 1, 2026 23:36
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 force-pushed the sam/pgo-consumption-43-x-y branch from 5b339fd to 8c8f8d2 Compare June 2, 2026 00:40
@MarshallOfSound MarshallOfSound added the backport-check-skip Skip trop's backport validity checking label Jun 3, 2026
@jkleinsc jkleinsc merged commit 68ee70c into 43-x-y Jun 3, 2026
128 of 131 checks passed
@jkleinsc jkleinsc deleted the sam/pgo-consumption-43-x-y branch June 3, 2026 15:47
@release-clerk

release-clerk Bot commented Jun 3, 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

43-x-y backport This is a backport PR backport-check-skip Skip trop's backport validity checking semver/none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants