Skip to content

perf: share the filesystem cache across validate and repair - #340

Merged
LadyBluenotes merged 1 commit into
mainfrom
perf/validate-share-fs-cache
Oct 19, 2026
Merged

LadyBluenotes merged 1 commit into
mainfrom
perf/validate-share-fs-cache

Conversation

@LadyBluenotes

@LadyBluenotes LadyBluenotes commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

  • runValidateCommandInternal and runRepairCommand previously destructured const { findSkillFiles } = createIntentFsCache() and discarded the IntentFsCache instance, so every resolveProjectContext and findWorkspacePackages call created a fresh cache or ran uncached, and collectPackagingWarnings and the packageName lookup before checkSkillBlocks re-read and parsed package.json from disk.
  • Keep fsCache in runValidateCommandInternal and runRepairCommand and pass it through resolveProjectContext, collectDefaultSkillsDirs, findWorkspacePackages, collectPackagingWarnings, repairRoot, and the packageName lookup before checkSkillBlocks.
  • On a single-package repository, intent validate now reads package.json once 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 (run pnpm build:all first).

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

@changeset-bot

changeset-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 505b3d0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/intent Patch

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

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 79d7cc2 and 505b3d0.

📒 Files selected for processing: 4
  • .changeset/validate-share-fs-cache.md
  • packages/intent/src/commands/repair.ts
  • packages/intent/src/commands/validate.ts
  • packages/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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 505b3d0

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:55 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/intent@340

commit: 505b3d0

@LadyBluenotes
LadyBluenotes merged commit cb45f14 into main Oct 19, 2026
8 of 9 checks passed
@LadyBluenotes
LadyBluenotes deleted the perf/validate-share-fs-cache branch October 19, 2026 00:50
@github-actions github-actions Bot mentioned this pull request Oct 19, 2026
@codspeed

codspeed Bot commented Oct 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 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.

Measurement and system calls

✅ 12 untouched benchmarks


Comparing perf/validate-share-fs-cache (505b3d0) with main (79d7cc2)

Open in CodSpeed

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.

1 participant