perf: skip redundant filesystem probes during discovery and load path rewriting #344
main fromrefs/pull/344/head·merged by LadyBluenotes(GitHub profile, opens in a new tab) 🎯 Changes#
- In
rewriteSkillLoadPaths, skipexistsSync(join(projectRoot, 'node_modules', packageName))whenpackageRootis already that top-levelnode_modules/<package>directory. - In
createPackageKindResolver, return() => 'npm'immediately whenworkspacePackageKeys.size === 0instead of callinggetFsIdentity(packageRoot)on every package. - In
tryRegister, check raw-path deduplication (attemptedRawDirs) andopts.exists(join(dirPath, 'skills'))beforeshouldAttemptPackageRoot(dirPath)solstatSyncandrealpathSyncare not run onnode_modulespackages that do not ship askills/directory. - Command output, symlink deduplication, and exit codes do not change.
Benchmark (benchmarks/intent, Vitest 4.1.11 on Windows Node) | main (cb45f14) mean (rme) | PR (f6b436e) mean (rme) | Change |
|---|---|---|---|
list.bench.ts (scans a consumer workspace) | 65.23 ms (±4.86%) | 52.92 ms (±1.38%) | -18.9% (1.23x) |
load.bench.ts (loads a direct dependency skill) | 19.30 ms (±1.32%) | 17.23 ms (±1.04%) | -10.7% (1.12x) |
✅ 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:
c8f3b77b-7d63-41fd-a794-feeb097504a1
📥 Commits
-
Reviewing files that changed from the base of the PR and between 9400b3ea5ad5c378f04993fa197cacfe7c1c05ac and f6b436e333aff8a06813fdd6e160600afa974e18.
📒 Files selected for processing: 5
-
.changeset/cut-discovery-fs-probes.mdpackages/intent/src/discovery/register.tspackages/intent/src/discovery/scanner.tspackages/intent/src/skills/paths.tspackages/intent/tests/repeated-work.test.ts
+--------------------------------------------------------------------------------------------+ | It is easier to change the specification to fit the program than vice versa. - Alan Perlis | +--------------------------------------------------------------------------------------------+ \ \ /)/) ( '') / | 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 f6b436e333aff8a06813fdd6e160600afa974e18
Command Status Duration Result nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded 1m 3s View ↗ nx run-many --targets=build✅ Succeeded 1s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-19 01:19:35UTCMerging 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.
: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/discovery-fs-probes(f6b436e) withmain(9400b3e)
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: f6b436e333aff8a06813fdd6e160600afa974e18
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