Skip to content

src: implement initial simdjson parser#61641

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

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

Conversation

@araujogui
Copy link
Member

@araujogui araujogui commented Feb 2, 2026

#61577

Input Native ops Node ops Node vs Native
simple-string 4,504,385.62 4,975,922.17 +10.5%
simple-array 703,598.73 562,547.42 −20.0%
simple-object 686,461.43 200,551.63 −70.8%
nested-ascii 202,770.63 67,469.96 −66.7%
nested-unicode 120,913.34 53,919.80 −55.4%
twitter 870.53 277.69 −68.1%

@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
Copy link
Member Author

Initial benchmark results:

parse-json/parse.js parser="native" type="small-object" n=100000: 5,367,434.433433749
parse-json/parse.js parser="simdjson" type="small-object" n=100000: 1,570,256.2069283628
parse-json/parse.js parser="native" type="small-array" n=100000: 10,437,233.452627432
parse-json/parse.js parser="simdjson" type="small-array" n=100000: 1,914,118.2972960686
parse-json/parse.js parser="native" type="medium-object" n=100000: 1,572,731.9730512376
parse-json/parse.js parser="simdjson" type="medium-object" n=100000: 411,978.48030408134
parse-json/parse.js parser="native" type="large-array" n=100000: 64,549.22266911664
parse-json/parse.js parser="simdjson" type="large-array" n=100000: 17,891.37742317745
parse-json/parse.js parser="native" type="deep-nesting" n=100000: 1,118,300.8536829143
parse-json/parse.js parser="simdjson" type="deep-nesting" n=100000: 538,687.0436317436
parse-json/parse.js parser="native" type="string-heavy" n=100000: 3,720,053.4765127357
parse-json/parse.js parser="simdjson" type="string-heavy" n=100000: 698,994.1781334098
parse-json/parse.js parser="native" type="number-heavy" n=100000: 616,398.9881120243
parse-json/parse.js parser="simdjson" type="number-heavy" n=100000: 201,247.07782954018

@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

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