perf: defer validate and review imports in maintainer command #345
main fromrefs/pull/345/head·merged by LadyBluenotes(GitHub profile, opens in a new tab) 🎯 Changes#
maintainer.tsstatically importedrunReviewCommand(./review.js),runValidateCommand(./validate.js), anddescribeSkillExamples(../validate/blocks.js), which loaded the validation, example-checking, and review command chunks on everyintent maintainerinvocation (setup,add,remove,sync,status --json) and caused Rolldown to emit a duplicatedist/review-*.mjs(0.09 kB) facade chunk.- Defer
./review.jsto theaction === 'review'branch,./validate.jstoaction === 'check', and../validate/blocks.jsto non-JSONaction === 'status'. - Eliminates the
dist/review-*.mjsfacade chunk and keepsvalidate-*.mjs,blocks-*.mjs,review-*.mjs, andworkflow-review-*.mjs(~78 kBcombined) off the startup path ofmaintainer setup,add,remove,sync, andstatus --json. - Command output and exit codes do not change.
Benchmark (benchmarks/intent/maintainer.bench.ts, Vitest 4.1.11 on Windows Node) | main (cb45f14) mean (min / rme) | PR (d54c07e) mean (min / rme) | Change |
|---|---|---|---|
maintainer setup with 20 existing skills | 240.04 ms (min 233.73 ms, ±1.09%) | 229.63 ms (min 220.41 ms, ±2.22%) | -4.3% (-10.4 ms) |
✅ 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
Warning
Review limit reached#
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 59 minutes.
View limit details
-
Limit details: You’ve used all 2 included reviews currently available.
Review configuration:
⚙️ Run configuration
-
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b044a0ec-658a-4947-9b63-5aa28616064e
📥 Commits
-
Reviewing files that changed from the base of the PR and between 9400b3ea5ad5c378f04993fa197cacfe7c1c05ac and d54c07e2bf7087efb2f8a0f59761624d00b9d7dc.
📒 Files selected for processing: 2
-
.changeset/defer-maintainer-validate-review.mdpackages/intent/src/commands/maintainer.ts
-
- 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 d54c07e2bf7087efb2f8a0f59761624d00b9d7dc
Command Status Duration Result nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded 1m 4s View ↗ nx run-many --targets=build✅ Succeeded 1s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-19 01:19:40UTCMerging this PR will not alter performance#
:warning: 9 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/static-loaded-command-imports(d54c07e) withmain(9400b3e)
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: d54c07e2bf7087efb2f8a0f59761624d00b9d7dc
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