Skip to content

deps,src: update simdjson and trim its includes - #66620

Open
lemire wants to merge 2 commits into
nodejs:mainfrom
lemire:deps-simdjson-5.0.3
Open

lemire wants to merge 2 commits into
nodejs:mainfrom
lemire:deps-simdjson-5.0.3

Conversation

@lemire

@lemire lemire commented Oct 9, 2026

Copy link
Copy Markdown
Member

This has two commits:

  1. deps: update simdjson to 5.0.3, using
    tools/dep_updaters/update-simdjson.sh. simdjson 5.0.2 (deps: update simdjson to 5.0.2 #66495)
    fails to compile with Apple clang 17 (Xcode 26.3) under
    -fno-exceptions, which is within the supported range
    (Xcode >= 16.4):

    simdjson.h: error: cannot use 'throw' with exceptions disabled
    

    5.0.3 fixes it.

  2. src: stop including simdjson.h from env.h. env.h included it
    through inspector_profiler.h, so about 155 files in src/ parsed the
    10 MB amalgamated header. Now only the 8 files that use simdjson
    include it. A clean rebuild of src/ takes 15% less CPU time
    (376 s to 320 s) and 19% less wall time (36.9 s to 29.8 s, -j14,
    Apple M-series). The startup and runtime benchmarks I ran
    (startup, module loading, --cpu-prof, NODE_V8_COVERAGE, the
    config file and node --run) show no regression.

Release notes:

Refs: simdjson/simdjson#2913
Refs: #66495

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/inspector
  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Oct 9, 2026
@lemire lemire added dependencies PRs that add, update, or configure Node.js dependencies. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Oct 9, 2026
env.h includes inspector_profiler.h, which included simdjson.h for
the types of two virtual methods and a parser member. As a result,
about 155 files in src/ parsed the amalgamated simdjson header,
which is over 10 MB.

Keep simdjson out of inspector_profiler.h: the profile connections
now say which field of `result` holds the profile, and
WriteProfile() takes the profile as raw JSON. The parser becomes a
local variable, so its buffers are no longer kept alive for the
lifetime of the Environment.

Also drop the unused include from node_task_runner.h, and let the
config file reader rewind its document instead of parsing the whole
file a second time with a second parser.

Now only the eight files that use simdjson include it. On an Apple
M-series machine, a clean rebuild of the src/ objects takes about
15% less CPU time (376 s to 320 s) and 19% less wall time at -j14.

Signed-off-by: Daniel Lemire <daniel@lemire.me>
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.71429% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.43%. Comparing base (dd9777b) to head (2b17b43).
⚠️ Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
src/inspector_profiler.cc 56.52% 6 Missing and 4 partials ⚠️
src/node_config_file.cc 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66620      +/-   ##
==========================================
- Coverage   92.78%   90.43%   -2.35%     
==========================================
  Files         422      791     +369     
  Lines      193692   276572   +82880     
  Branches    29881    53108   +23227     
==========================================
+ Hits       179714   250116   +70402     
- Misses      13650    16859    +3209     
- Partials      328     9597    +9269     
Files with missing lines Coverage Δ
src/inspector_profiler.h 86.95% <100.00%> (ø)
src/node_task_runner.cc 89.78% <ø> (ø)
src/node_config_file.cc 85.05% <66.66%> (ø)
src/inspector_profiler.cc 83.25% <56.52%> (ø)

... and 496 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.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@github-actions github-actions Bot added request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. and removed request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Oct 9, 2026
@lemire lemire removed the request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. label Oct 10, 2026
@lemire
lemire requested review from aduh95 and richardlau October 10, 2026 02:05
@nodejs nodejs deleted a comment from github-actions Bot Oct 10, 2026
@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 Oct 10, 2026
@panva panva added the commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. label Oct 10, 2026
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. commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. dependencies PRs that add, update, or configure Node.js dependencies. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants