electron/script
Samuel Attard 6b2354f7dc
build: consume Electron-generated PGO profiles in release builds (42-x-y) (#51828)
build: consume Electron-generated PGO profiles in release builds

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%.
2026-06-01 16:04:47 -07:00
..
actions build: generate Electron-specific PGO profiles in CI (#51826) 2026-06-01 12:54:22 -07:00
codesign chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
lib chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
lint-plugins chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
node fix: pass root_gen_dir from GN to generate_node_headers.py (#50872) 2026-04-10 12:15:08 +02:00
pgo build: consume Electron-generated PGO profiles in release builds (42-x-y) (#51828) 2026-06-01 16:04:47 -07:00
release chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
zip_manifests fix: enable shader-f16 on windows (#48342) 2025-10-14 15:46:12 +02:00
apply_all_patches.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
build-stats.mjs chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
check-patch-diff.ts chore: bump chromium to 121.0.6104.0 (main) (#40418) 2023-11-03 15:37:55 -04:00
check-symlinks.js refactor: use node scheme imports in scripts (#38846) 2023-06-22 16:21:42 +02:00
copy-pipeline-segment-publish.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
cp.mjs build: drop shx dependency (#47293) 2025-05-30 10:59:11 +02:00
create-api-json.mjs chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
dbus_mock.py fix: linux test shutdown error "AttributeError: type object 'DBusTestCase' has no attribute 'stop_dbus'" (#51149) 2026-04-19 00:52:58 -07:00
doc-only-change.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
export_all_patches.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
gen-filenames.ts build: add --check option to script/gen-filenames.ts and extend CI check (#51721) 2026-05-27 09:48:08 -04:00
gen-hunspell-filenames.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
gen-libc++-filenames.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
generate-config-gypi.py build: fix python warnings "SyntaxWarning: invalid escape sequence '\w'" (#44650) 2024-11-14 12:27:20 +01:00
generate-deps-hash.js build: use github actions for windows (#44136) 2024-12-12 11:51:24 -05:00
generate-mas-config.py build: make is_mas_build a generated header instead of config (#43737) 2024-09-17 01:38:56 -07:00
generate-version-json.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
generate-zip-manifest.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
get-git-ref-paths.py build: resolve electron_version from git when building in a worktree (#51166) 2026-04-20 08:24:33 -05:00
get-git-version.py fix: only remove the 'v' prefix from the git tag name (#45132) 2025-01-13 22:36:03 -05:00
git-export-patches build: export matching patches (#41174) 2024-02-08 13:47:59 -05:00
git-import-patches build: explicitly run scripts with python3 (#33720) 2022-04-12 13:21:55 +02:00
gn-asar-hash.js build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
gn-asar.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
gn-check.js build: don't use //third_party/depot_tools in gn build scripts (#50922) 2026-04-11 09:46:52 +02:00
gn-plist-but-with-hashes.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
lint-roller-chromium-changes.mjs chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
lint.js build: generate Electron-specific PGO profiles in CI (#51826) 2026-06-01 12:54:22 -07:00
nan-spec-runner.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
node-disabled-tests.json chore: bump node to v24.14.0 (main) (#49941) 2026-02-26 10:32:14 -05:00
node-spec-runner.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
patch-up.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
patches-mtime-cache.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
patches-stats.mjs chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
qemu-init.sh ci: test linux 64k (#50358) 2026-03-19 09:31:47 -04:00
run-clang-format.py build: fix clang-format duplicate message (#45235) 2025-01-20 11:05:40 +01:00
run-clang-tidy.ts chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
run-if-exists.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
run-qemu-64k.sh ci: test linux 64k (#50358) 2026-03-19 09:31:47 -04:00
spec-runner.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
split-tests.js test: run visibility-state-spec.ts first (#44206) 2024-10-14 09:40:22 -04:00
start.js fix: remove killed check to allow multiple signals (#40667) 2025-10-23 15:20:04 -04:00
sysroots.json build: roll sysroots (#49844) 2026-02-18 13:24:29 -05:00
tar.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
verify-chromedriver.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
verify-ffmpeg.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
verify-mksnapshot.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
wayland-test-allowlist.txt ci: run BrowserWindow test spec on Wayland (#50658) 2026-04-03 10:25:48 -05:00
yarn.js build: upgrade yarn to 4.12.0 (#49176) 2025-12-10 14:04:14 -05:00
zip-symbols.py build: apply additional compression to dsym on upload (#48930) 2025-11-13 10:43:53 +01:00