Skip to content

build: enable pie on linux - #67386

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
legendecas:build-pie-linux
Nov 15, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
legendecas:build-pie-linux

Conversation

@legendecas

@legendecas legendecas commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Refs: #66951

In my testing on a linux RHEL 8 host, built with gcc (not clang as in our release toolchain), it shows no significant performance cost either on startup time, binary size, or runtime cpp heavy path:

non-PIE PIE
node -e 0 median, run 1 24.12 ms 25.72 ms (+1.60 ms, +6.6%)
node -e 0 median, run 2 23.64 ms 25.04 ms (+1.40 ms, +5.9%)
.rela.dyn 3.5 KB 2.65 MB
.data.rel.ro 97 KB 1.38 MB
.text 56.7 MB 57.7 MB (+1.7%)
file size (not stripped) 146.0 MB 149.0 MB (+2.1%)

and with benchmark/compare.js --runs 30 --set inLen=1024 --set chunkLen=256 --set CPUSET=3 string_decoder:

encoding PIE vs non-PIE
ascii −1.71% (*)
utf8 −0.39%
base64-utf8 +3.48% (***)
base64-ascii +3.29% (***)
utf16le +1.26%

with string_decoder/string-decoder-create.js as a control group, mostly JS object creation, n=25000000, it even seems slightly faster with *** confidence:

encoding PIE vs non-PIE
ascii +4.85% (***)
utf8 +5.54% (***)
utf-8 +5.15% (***)
base64 +3.77% (***)
ucs2 +3.24% (***)
UTF-8 +3.02% (**)
AscII +3.08% (***)
UTF-16LE +5.22% (***)

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
@nodejs-github-bot

nodejs-github-bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/build

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. labels Nov 10, 2026
@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 12, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 12, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. labels Nov 13, 2026
@nodejs-github-bot nodejs-github-bot added the lacks-second-approval Commit Queue PRs awaiting a second collaborator approval or completion of the required wait. label Nov 13, 2026

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nodejs-github-bot
nodejs-github-bot merged commit 2a854a8 into nodejs:main Nov 15, 2026
84 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 2a854a8

@nodejs-github-bot nodejs-github-bot removed commit-queue PRs queued for automated landing through the Commit Queue. lacks-second-approval Commit Queue PRs awaiting a second collaborator approval or completion of the required wait. labels Nov 15, 2026
@legendecas
legendecas deleted the build-pie-linux branch November 16, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants