Skip to content

Comments

perf: use simd-json for package.json parsing#761

Merged
graphite-app[bot] merged 1 commit intomainfrom
perf/simd-json-package-json
Oct 17, 2025
Merged

perf: use simd-json for package.json parsing#761
graphite-app[bot] merged 1 commit intomainfrom
perf/simd-json-package-json

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Oct 17, 2025

Summary

Replace serde_json with simd-json using BorrowedValue for zero-copy JSON parsing. Uses self_cell to manage the self-referential structure where the parsed JSON borrows from the original string.

Breaking change:

  • raw API with package_json_raw_json_api feature is removed.
  • Returned error no longer has line and column information.

🤖 Generated with Claude Code

@graphite-app
Copy link

graphite-app bot commented Oct 17, 2025

How to use the Graphite Merge Queue

Add the label merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 74.10714% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.18%. Comparing base (880d861) to head (c2da024).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/package_json.rs 71.56% 29 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #761      +/-   ##
==========================================
- Coverage   95.09%   94.18%   -0.91%     
==========================================
  Files          16       16              
  Lines        2974     3028      +54     
==========================================
+ Hits         2828     2852      +24     
- Misses        146      176      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 17, 2025

CodSpeed Performance Report

Merging #761 will degrade performances by 10.89%

Comparing perf/simd-json-package-json (c2da024) with main (19902fb)

Summary

⚡ 3 improvements
❌ 1 regression
✅ 3 untouched
⏩ 2 skipped1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
complex_real 33.4 µs 22.4 µs +48.86%
large 44.1 µs 26.4 µs +66.97%
medium 23.1 µs 17.3 µs +33.81%
small 10.3 µs 11.6 µs -10.89%

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Boshen Boshen force-pushed the perf/simd-json-package-json branch 2 times, most recently from 81e3b03 to 097e5c7 Compare October 17, 2025 04:09
@Boshen Boshen marked this pull request as ready for review October 17, 2025 04:12
@Boshen Boshen changed the title perf: use simd-json with BorrowedValue for package.json parsing perf: use simd-json for package.json parsing Oct 17, 2025
@Boshen Boshen force-pushed the perf/simd-json-package-json branch 2 times, most recently from bc9e74c to 501e2fd Compare October 17, 2025 04:18
@Boshen Boshen added the merge label Oct 17, 2025
Copy link
Member Author

Boshen commented Oct 17, 2025

Merge activity

## Summary

Replace `serde_json` with `simd-json` using `BorrowedValue` for zero-copy JSON parsing. Uses `self_cell` to manage the self-referential structure where the parsed JSON borrows from the original string.

Breaking change:

* raw API with `package_json_raw_json_api` feature is removed.
* Returned error no longer has line and column information.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app bot force-pushed the perf/simd-json-package-json branch from 501e2fd to c2da024 Compare October 17, 2025 04:24
@graphite-app graphite-app bot merged commit c2da024 into main Oct 17, 2025
16 of 17 checks passed
@graphite-app graphite-app bot deleted the perf/simd-json-package-json branch October 17, 2025 04:27
@Boshen Boshen mentioned this pull request Oct 16, 2025
@graphite-app graphite-app bot removed the merge label Oct 17, 2025
graphite-app bot pushed a commit to rolldown/rolldown that referenced this pull request Oct 17, 2025
30 - 60% performance improvement + huge memory reduction from oxc-project/oxc-resolver#761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants