perf: split jsonc-parser edit and format out of project-context #343
main fromrefs/pull/343/head·merged by LadyBluenotes(GitHub profile, opens in a new tab) 🎯 Changes#
workspace-patterns.tsimportedparsefrom'jsonc-parser', whichtsdown.config.tsaliased tojsonc-parser/lib/esm/main.js. Becausemain.jsalso imports./impl/editand./impl/format(used byinstallandmaintainer), Rolldown bundled the entirejsonc-parsermodule graph (scanner.js,string-intern.js,format.js,parser.js,edit.js,main.js) into the shareddist/project-context-*.mjschunk, which is loaded on startup byintent list,intent load,intent stale, andintent validate.- Point
workspace-patterns.ts'sjsonc-parser/lib/esm/main.jsimport atjsonc-parser/lib/esm/impl/parser.jsintsdown.config.ts, soedit.js,format.js,string-intern.js(which eagerly allocates 1,220 whitespace strings at module evaluation time), andmain.jsmove into a separate chunk (dist/main-*.mjs) loaded only byinstallandmaintainer. dist/project-context-*.mjsshrinks from54.14 kBraw (11.82 kBgzip) to34.21 kBraw (7.83 kBgzip) —-19.93 kBraw (-3.99 kBgzip) on every read-only CLI command.- Command output, Deno workspace parsing, and exit codes do not change.
Metric (tsdown v0.22.14 / rolldown v1.2.12) | main (cb45f14) | PR (9a61b1e) | Change |
|---|---|---|---|
dist/project-context-*.mjs (raw) | 54.14 kB (54,141 B) | 34.21 kB (34,213 B) | -19.93 kB (-36.8%) |
dist/project-context-*.mjs (gzip) | 11.82 kB | 7.83 kB | -3.99 kB (-33.8%) |
✅ Checklist#
- I have followed the steps in the Contributing guide.
- I have tested this code locally with
pnpm run test:pr(runpnpm build:allfirst).
🚀 Release Impact#
- This change affects published code, and I have generated a changeset.
- This change is docs/CI/dev-only (no release).
- 1
Note
Currently processing new changes in this PR. This may take a few minutes, please wait...
⚙️ Run configuration
-
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
58396e9c-cfe3-469a-8b4e-126a6a2ca918
📥 Commits
-
Reviewing files that changed from the base of the PR and between 9400b3ea5ad5c378f04993fa197cacfe7c1c05ac and 9a61b1e361c83aaf8d7dd2c9669ef6ac8433342a.
📒 Files selected for processing: 3
-
.changeset/split-jsonc-parser-edit.mdpackages/intent/src/setup/workspace-patterns.tspackages/intent/tsdown.config.ts
+------------------------------------------------------------+ | To infinity and beyond! Scouring your code for pesky bugs. | +------------------------------------------------------------+ \ \ (\__/) (•ㅅ•) / づ✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment `@coderabbitai help` to get the list of available commands.-
View your CI Pipeline Execution ↗ for commit 9a61b1e361c83aaf8d7dd2c9669ef6ac8433342a
Command Status Duration Result nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded 1m 2s View ↗ nx run-many --targets=build✅ Succeeded 1s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-19 01:19:29UTCMerging this PR will not alter performance#
:warning: 8 benchmarks spent significant time in system calls
System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.
:information_source: 7 benchmarks have no flame graph
The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.
✅ 12untouched benchmarks
Comparingperf/jsonc-parser-split(9a61b1e) withmain(9400b3e)
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 9a61b1e361c83aaf8d7dd2c9669ef6ac8433342a
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR