Skip to content

build: enable -fvisibility to improve startup speeds - #65526

Open
avivkeller wants to merge 1 commit into
nodejs:mainfrom
avivkeller:improve-startup
Open

build: enable -fvisibility to improve startup speeds#65526
avivkeller wants to merge 1 commit into
nodejs:mainfrom
avivkeller:improve-startup

Conversation

@avivkeller

@avivkeller avivkeller commented Aug 25, 2026

Copy link
Copy Markdown
Member

cc @joyeecheung this resolves your TODO(joyeecheung): investigate if it breaks addons. comment.

If I understand correctly, this is fine to enable, since:

  • All addon test suites pass against the build (on my mac)
  • The removed strong symbols are declared only in internal headers under an internal namespace used only internslly. (With the addition of signo_string). Weak symbols don't matter here.

Plus, it speeds up startups by ~33% (yay!):

Running JS (--eval)

$ hyperfine --warmup 30 --runs 60 'node -e 0' './node -e 0'

Benchmark 1: node -e 0
  Time (mean ± σ):      61.6 ms ±  11.9 ms    [User:42.7 ms, System: 12.8 ms]
  Range (min … max):    45.9 ms … 108.5 ms    60 runs
 
Benchmark 2: ./node -e 0
  Time (mean ± σ):      45.4 ms ±   8.7 ms    [User:29.3 ms, System: 12.2 ms]
  Range (min … max):    31.2 ms …  79.3 ms    60 runs
 
Summary
  ./node -e 0 ran
    1.36 ± 0.37 times faster than node -e 0

--version Only

$ hyperfine --warmup 30 --runs 60 'node --version' './node --version'

Benchmark 1: node --version
  Time (mean ± σ):      36.9 ms ±  10.8 ms    [User:25.1 ms, System: 7.0 ms]
  Range (min … max):    25.7 ms …  83.5 ms    60 runs
 
Benchmark 2: ./node --version
  Time (mean ± σ):      23.6 ms ±  10.5 ms    [User:11.3 ms, System: 6.2 ms]
  Range (min … max):    11.0 ms …  65.4 ms    60 runs
 
Summary
  ./node --version ran
    1.56 ± 0.84 times faster than node --version

@avivkeller
avivkeller requested a review from joyeecheung August 25, 2026 04:37
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/url
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Aug 25, 2026
Signed-off-by: avivkeller <me@aviv.sh>
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (18eaa73) to head (349d171).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #65526   +/-   ##
=======================================
  Coverage   90.13%   90.14%           
=======================================
  Files         751      751           
  Lines      253656   253679   +23     
  Branches    47787    47788    +1     
=======================================
+ Hits       228631   228668   +37     
- Misses      16258    16266    +8     
+ Partials     8767     8745   -22     
Files with missing lines Coverage Δ
src/node.h 92.30% <ø> (ø)

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants