Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Enabling PGO for Windows releases

未关闭
#4,452 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
node.js, powershell

调研方向

首先检查 issue 中显示的 Jenkins job 草案和当前的 release 命令,然后检查 pgo.ps1 和 vcbuild.bat 的 PGO 参数。以 job 草案作为验证参考,确认 release 构建可以在 nightly 中完成三个 PGO 步骤,同时 nightly 和 canary 构建保留非 PGO 路径。

由索引模型根据 Issue 内容生成。

描述

ci-release jenkins platform:windows

I want to start a discussion about enabling PGO for release builds on Windows. Along with LTO (enabled since v26.3), it will further improve Node.js performance on Windows. While LTO builds took 3-3.5 hours initially, recent changes have reduced them to around 2 hours. Enabling PGO will double that time (2 builds are needed plus running workload scripts in between), but overall it will be a bit longer than what LTO took last week. Additionally, I would only enable PGO for release builds, so nightly and canary builds would be unaffected. I feel confident in enabling this because I've already tested it thoroughly in a draft job.

Since Jenkins changes are only visible after they are made, I want to share what I plan to change here before doing it. What we currently have is this:

vcbuild.bat build-release %ARCH% upload

and I would change it to this:

if not exist pgo.ps1 goto :no-pgo
if not "%DISTTYPE%"=="release" goto :no-pgo

echo === PGO Build: Step 1 - Build instrumented binary ===
@REM In first PGO build, make x64 binary to generate profdata (Eventually we want to add ARM64 machines for this)
call vcbuild.bat build-release x64 pgo-generate
if errorlevel 1 exit /b %errorlevel%

echo === PGO Build: Step 2 - Run workload and collect profiles ===
powershell -NoProfile -ExecutionPolicy Bypass -File pgo.ps1 -PgoGenNode Release\node.exe -PhaseOnly
if errorlevel 1 exit /b %errorlevel%
echo --- Cleaning instrumented build ---
git clean -fdx -e node.profdata
if errorlevel 1 exit /b %errorlevel%

echo === PGO Build: Step 3 - Build optimized binary ===
call vcbuild.bat build-release %ARCH% pgo-use upload
exit /b %errorlevel%

:no-pgo
echo === Non-PGO Build ===
vcbuild.bat build-release %ARCH% upload

The script checks whether the Node.js being built has PGO enabled, and if so, it uses it for release builds. This way, if/when we backport PGO to LTS versions, they will pick it up for releases without any further changes in Jenkins.

As I've already stated, I tested this and feel confident about enabling it, but please feel free to share any concerns you might have about these changes.

主要语言
Jinja
星标
541
派生
185
平均合并
2 天 18 小时
30 天内合并 PR
6

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nodejs/build 的其他 Issue

查看 nodejs/build 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。