perf: share package context, path checks, and frontmatter across maintainer batches #337
main fromrefs/pull/337/head·merged by LadyBluenotes(GitHub profile, opens in a new tab) 🎯 Changes#
intent maintainer setupdiscovered existing skills infindExistingSkillsand then passed them toplanAddSkills, which repeatedprojectPathlstatSyncwalks, uncachedresolveProjectContextancestor walks,package.jsonreads, andSKILL.mdfrontmatter reads across the batch.resolveProjectContextnow cachesfindOwningPackageRootresults perIntentFsCacheand uses a singlestatSync(path, { throwIfNoEntry: false })probe intoSearchDir.projectPath,skillPath,recordPath,readRecord, andskillEntriesaccept a per-batchSet<string>of verified non-symlink paths so shared directory prefixes are checked once per operation.findExistingSkills,planSetupRecords, andplanAddSkillsshare oneIntentFsCache, verified path set, and parsedSKILL.mdfrontmatter acrossmaintainer setup(planMaintainerSyncalso sharesfsCacheand verified paths across its skill loop), andfindExistingSkillscounts duplicate names in aMapinstead of an $O(N^2)$skills.some(...)scan.- Command output, validation rules, and exit codes do not change.
Benchmark (benchmarks/intent/maintainer.bench.ts, Vitest 4.1.11 on Windows Node) | main (ab9877c) mean (rme) | PR (2156afb) mean (rme) | Change |
|---|---|---|---|
maintainer setup with 20 existing skills | 493.33 ms (±4.50%) | 240.12 ms (±1.89%) | -51.3% (2.05x) |
maintainer setup with 200 existing skills | 1,509.42 ms (±5.68%) | 397.76 ms (±4.87%) | -73.6% (3.79x) |
✅ 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:
8e822157-7451-49be-8a2e-1300f779a878
📥 Commits
-
Reviewing files that changed from the base of the PR and between ab9877c50888913e45afea92a0a87169de9c7d84 and 2156afbca7f99a6fcab1a7765d2db076b07b1784.
📒 Files selected for processing: 8
-
.changeset/maintainer-setup-batch.mdpackages/intent/src/commands/maintainer.tspackages/intent/src/core/project-context.tspackages/intent/src/maintainer/add.tspackages/intent/src/maintainer/existing.tspackages/intent/src/maintainer/project.tspackages/intent/src/maintainer/sync.tspackages/intent/tests/repeated-work.test.ts
+-----------------------------------------+ | Code review, I will. Find bugs, I must. | +-----------------------------------------+ \ \ (\__/) (•ㅅ•) / づ✨ 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 2156afbca7f99a6fcab1a7765d2db076b07b1784
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 00:37:33UTCMerging 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/maintainer-setup-batch(2156afb) withmain(ab9877c)
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 2156afbca7f99a6fcab1a7765d2db076b07b1784
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