Skip to content

src: implement initial simdjson parser#61641

Draft
araujogui wants to merge 16 commits intonodejs:mainfrom
araujogui:simdjson
Draft

src: implement initial simdjson parser#61641
araujogui wants to merge 16 commits intonodejs:mainfrom
araujogui:simdjson

Conversation

@araujogui
Copy link
Member

@araujogui araujogui commented Feb 2, 2026

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/loaders
  • @nodejs/startup

@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 Feb 2, 2026
@araujogui

This comment was marked as outdated.

@jsumners-nr
Copy link

native simdjson
small-object 5,367,434.433433749 1,570,256.2069283628
small-array 10,437,233.452627432 1,914,118.2972960686
medium-object 1,572,731.9730512376 411,978.48030408134
large-array 64,549.22266911664 17,891.37742317745
deep-nesting 1,118,300.8536829143 538,687.0436317436
string-heavy 3,720,053.4765127357 698,994.1781334098
number-heavy 616,398.9881120243 201,247.07782954018

Unless I copied and pasted incorrectly, it looks like this effort will not be beneficial?

@araujogui
Copy link
Member Author

native simdjson
small-object 5,367,434.433433749 1,570,256.2069283628
small-array 10,437,233.452627432 1,914,118.2972960686
medium-object 1,572,731.9730512376 411,978.48030408134
large-array 64,549.22266911664 17,891.37742317745
deep-nesting 1,118,300.8536829143 538,687.0436317436
string-heavy 3,720,053.4765127357 698,994.1781334098
number-heavy 616,398.9881120243 201,247.07782954018

Unless I copied and pasted incorrectly, it looks like this effort will not be beneficial?

I believe it’s too early to reach any conclusions, this PR is very tricky

@AugustinMauroy
Copy link
Member

What if you add test to ensure that error between standard json parsing and this new api is near to 1:1. In goal of allowing user to use both without big diff.
It's will also help for adoption so just have to change the function call not their potential parent try/catch statement

@araujogui
Copy link
Member Author

New benchmark results:

n = 10

Input Native ops Node ops Node vs Native
nested-ascii 92095.45 93059.61 +1.0%
nested-unicode 66759.24 71047.96 +6.4%
simple-number-array 194174.76 200839.51 +3.4%
simple-object 151609.33 192463.14 +26.9%
simple-string 237625.64 301132.26 +26.7%
simple-string-array 223463.69 281357.27 +25.9%
twitter 842.55 588.56 -30.1%

n = 1024

Input Native ops Node ops Node vs Native
nested-ascii 216974.07 154869.93 -28.6%
nested-unicode 133555.06 104850.44 -21.5%
simple-number-array 681757.66 654034.35 -4.1%
simple-object 737663.41 664198.41 -10.0%
simple-string 4430502.97 6460567.82 +45.8%
simple-string-array 2367630.06 2692965.15 +13.7%
twitter 1005.43 733.20 -27.1%

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.

4 participants