Skip to content

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

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
JaneaSystems:mefi-thin-lto
May 20, 2026
Merged

build,win: build,win: replace LTCG with Thin LTO for releases#63114
nodejs-github-bot merged 2 commits into
nodejs: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
@StefanStojanovic
Copy link
Copy Markdown
Contributor Author

Pinging @nodejs/releasers and @nodejs/build again for visibility (@nodejs/platform-windows too).

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels May 20, 2026
Signed-off-by: StefanStojanovic <stefan.stojanovic@janeasystems.com>
Signed-off-by: StefanStojanovic <stefan.stojanovic@janeasystems.com>
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 20, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels May 20, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 20, 2026
@nodejs-github-bot nodejs-github-bot merged commit 614050b into nodejs:main May 20, 2026
71 of 72 checks passed
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Landed in 614050b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. build Issues and PRs related to build files or the CI. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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.

4 participants