FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: use simdjson by himself65 · Pull Request #59308 · nodejs/node · GitHub

/ node Public

src: use simdjson - #59308

Closed
himself65 wants to merge 1 commit into
nodejs:mainfrom
himself65:himself65/2025/07/31/simdjson
Closed

src: use simdjson#59308
himself65 wants to merge 1 commit into
nodejs:mainfrom
himself65:himself65/2025/07/31/simdjson

Conversation

himself65 commented Aug 1, 2025
edited
Loading

Copy link
Copy Markdown
Member

Fixes: #59288

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Aug 1, 2025
himself65 force-pushed the himself65/2025/07/31/simdjson branch from 3b64484 to 31ca9cc Compare August 1, 2025 04:44
himself65 requested a review from joyeecheung August 1, 2025 05:13

codecov Bot commented Aug 1, 2025
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.74684% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.97%. Comparing base (91dadf2) to head (111b1c2).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
src/json_parser.cc 79.74% 4 Missing and 12 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59308      +/-   ##
==========================================
- Coverage   90.00%   89.97%   -0.03%     
==========================================
  Files         649      649              
  Lines      192180   192192      +12     
  Branches    37659    37684      +25     
==========================================
- Hits       172970   172933      -37     
+ Misses      11830    11829       -1     
- Partials     7380     7430      +50     
Files with missing lines Coverage Δ
src/json_parser.h 100.00% <ø> (ø)
src/json_parser.cc 74.75% <79.74%> (-5.25%) ⬇️

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

himself65 force-pushed the himself65/2025/07/31/simdjson branch from 5d360b4 to 7830986 Compare August 1, 2025 09:29
himself65 force-pushed the himself65/2025/07/31/simdjson branch from 7830986 to 111b1c2 Compare August 1, 2025 09:30
Comment thread src/json_parser.cc
json_content_.size());

simdjson::ondemand::document document;
simdjson::error_code error = parser_.iterate(json_view).get(document);

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Actually reading this I realized that if we are moving towards simdjson, it's better to just use simdjson directly in the callsite instead of shimming JSONParser over it, because simdjson does not really support random access, unlike the current JSON parser interface. As a result trying to shim it is bound to lead to repetitive parsing like what's happening here. The correct way to handle fields of unknown order is to just iterate over the fields and handle them for different specific key values on an ad-hoc basis, as suggested by the simdjson documentation: https://github.com/simdjson/simdjson/blob/master/doc/basics.md#using-the-parsed-json

For example, for SEA, this would be the recommended way to parse the document according to the simdjson documentaiton: #59323

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use simdjson in JSONParser

3 participants


Back | FazBrowse Home | New Git URL