Skip to content

build: enable ThinLTO link-time optimization for the main binary#51820

Merged
MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-build-enable-thinlto-link-time-optimization-for-the-main-binary-1780323796089
Jun 1, 2026
Merged

build: enable ThinLTO link-time optimization for the main binary#51820
MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-build-enable-thinlto-link-time-optimization-for-the-main-binary-1780323796089

Conversation

@trop
Copy link
Copy Markdown
Contributor

@trop trop Bot commented Jun 1, 2026

Backport of #51809

See that PR for details.

Notes: Improved performance of Linux and Windows release builds by enabling ThinLTO link-time optimization for the main Electron binary.

Chromium applies the thinlto_optimize_default config to all targets by
default, which passes --lto-O0 (Windows: /opt:lldlto=0) to the linker --
i.e. no optimization is performed during the ThinLTO link step. Chrome
opts its main binaries (chrome executable, chrome.dll, Chrome Framework)
into the thinlto_optimize_max config to get full link-time optimization,
but Electron never did, so release builds of Electron were linked with
--lto-O0 and lost most of the benefit of ThinLTO and PGO.

Swap in thinlto_optimize_max for electron_app (Linux/Windows) and
electron_framework (macOS), exactly like chrome/BUILD.gn does for its
equivalent targets.

Co-authored-by: Sam Attard <sattard@anthropic.com>
@trop trop Bot requested a review from MarshallOfSound June 1, 2026 14:23
@trop trop Bot added 43-x-y backport This is a backport PR semver/none labels Jun 1, 2026
@MarshallOfSound MarshallOfSound merged commit 697aa9f into 43-x-y Jun 1, 2026
77 of 79 checks passed
@MarshallOfSound MarshallOfSound deleted the trop/43-x-y-bp-build-enable-thinlto-link-time-optimization-for-the-main-binary-1780323796089 branch June 1, 2026 16:31
@release-clerk
Copy link
Copy Markdown

release-clerk Bot commented Jun 1, 2026

Release Notes Persisted

Improved performance of Linux and Windows release builds by enabling ThinLTO link-time optimization for the main Electron binary.

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.

1 participant