Skip to content

build,win: build,win: replace LTCG with Thin LTO for releases#63114

Open
StefanStojanovic wants to merge 2 commits intonodejs:mainfrom
JaneaSystems:mefi-thin-lto
Open

build,win: build,win: replace LTCG with Thin LTO for releases#63114
StefanStojanovic wants to merge 2 commits intonodejs:mainfrom
JaneaSystems:mefi-thin-lto

Conversation

@StefanStojanovic
Copy link
Copy Markdown
Contributor

This PR continues the work started in #62761, by using Thin LTO instead of LTCG for Node.js release builds on Windows.

The original idea was to switch from LTCG to Thin LTO, but it was noticed that this led to OOM errors on the release CI machines. As a result, a new option lto-jobs was added to limit the LTO job parallelisation, thus decreasing peak memory usage. That meant making the compilation (linker step) longer, but doable.

I've run benchmarks (10 runs each, on Windows x64) from Node.js, and the results are here. They show that this change improves performance in some cases, while some stay unaffected.

The second thing is the build time. I've had a few successful runs building this in the release CI (run1, run2), and the times were around 3 hours and 10 minutes on both x64 and arm64. This is quite an increase in what we see with LTCG, which is around 1 hour 10 minutes for x64and 1 hour 40 minutes for arm64. The main reason for this is the decreased linker parallelisation, which was needed because the machines we use for compilation have only 8GB of RAM. However, given the number of runs we have in the release CI and the number of machines we have there, this should be acceptable. (We have 3 machines, and each job does 2 Windows compilations).

cc @nodejs/releasers @nodejs/build

Refs: #61964

@StefanStojanovic StefanStojanovic added windows Issues and PRs related to the Windows platform. build Issues and PRs related to build files or the CI. release Issues and PRs related to Node.js releases. labels May 4, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. release Issues and PRs related to Node.js releases. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants