build: consume Electron-generated PGO profiles in release builds (42-x-y)#51828
Merged
Conversation
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%.
5 tasks
jkleinsc
approved these changes
Jun 1, 2026
dsanders11
approved these changes
Jun 1, 2026
|
Release Notes Persisted
|
This was referenced Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual backport of #51815 to 42-x-y.
02044ed2bc-stamped profiles uploaded from that runchrome_pgo_phase = 2machineryNotes: Improved runtime performance.