perf: share the filesystem cache across validate and repair #340
main fromrefs/pull/340/head·merged by LadyBluenotes(GitHub profile, opens in a new tab) 🎯 Changes#
runValidateCommandInternalandrunRepairCommandpreviously destructuredconst { findSkillFiles } = createIntentFsCache()and discarded theIntentFsCacheinstance, so everyresolveProjectContextandfindWorkspacePackagescall created a fresh cache or ran uncached, andcollectPackagingWarningsand thepackageNamelookup beforecheckSkillBlocksre-read and parsedpackage.jsonfrom disk.- Keep
fsCacheinrunValidateCommandInternalandrunRepairCommandand pass it throughresolveProjectContext,collectDefaultSkillsDirs,findWorkspacePackages,collectPackagingWarnings,repairRoot, and thepackageNamelookup beforecheckSkillBlocks. - On a single-package repository,
intent validatenow readspackage.jsononce instead of 4–5 times. - Command output, packaging warnings, and exit codes do not change.
Benchmark (benchmarks/intent/validate.bench.ts, Vitest 4.1.11 on Windows Node) | main (79d7cc2) mean (rme) | PR (505b3d0) mean (rme) | Change |
|---|---|---|---|
checks a shipped skills tree | 33.53 ms (±1.43%) | 25.06 ms (±0.72%) | -25.3% (1.34x) |
✅ 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).
Summary by CodeRabbit#
- Performance
- Validation and repair now reuse filesystem reads while resolving project context, discovering workspace packages and skills, and reading package manifests. This reduces repeated reads during a run.
- Behavior
- Validation and repair continue to behave as before. Missing package manifests still produce no warning, while other manifest read or parsing errors produce a warning.
- 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:
a8d1bb16-8e01-43bf-8b65-c019985da78d
📥 Commits
-
Reviewing files that changed from the base of the PR and between 79d7cc2694dd95ad438afef9d85836835a140885 and 505b3d0009f251a2c33a6ff920696c93eb36f604.
📒 Files selected for processing: 4
-
.changeset/validate-share-fs-cache.mdpackages/intent/src/commands/repair.tspackages/intent/src/commands/validate.tspackages/intent/tests/repeated-work.test.ts
+-------------------------------------------------------+ | Cancel my subscriptions ... I'm tired of your issues. | +-------------------------------------------------------+ \ \ /)/) ( '') / | o(___)✨ 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 505b3d0009f251a2c33a6ff920696c93eb36f604
Command Status Duration Result nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded 50s View ↗ nx run-many --targets=build✅ Succeeded 2s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-19 00:49:55UTCMerging this PR will not alter performance#
:warning: 7 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.
✅ 12untouched benchmarks
Comparingperf/validate-share-fs-cache(505b3d0) withmain(79d7cc2)
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 505b3d0009f251a2c33a6ff920696c93eb36f604
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