perf(cli): shrink help sorting without allocating cached keys - #1396
Conversation
Entire-Checkpoint: 01M1X151XSYT9H3094FKJSNGCM
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughHelp ordering now uses outlined comparators and declaration-position lookup. Recursive command ordering shares one implementation. Tests cover edge cases and tie-breaking. A new benchmark binary measures help rendering, KDL serialization, and recursive help rendering. ChangesHelp ordering
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to Help-row ordering now computes declaration positions efficiently while preserving explicit display ordering and tie-breaking. The changed ordering paths and regression cases show no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
Entire-Checkpoint: 01M1X2X9FX4CSCJ16YYF663QDC
Instruction countsThe comparison never ran — an earlier step failed.
|
### 🚀 Features - **(help)** allow remapping semantic colours on Style by [@lu-zero](https://github.com/lu-zero) in [#1414](#1414) - **(parse)** add opt-in default-subcommand flag routing by [@jdx](https://github.com/jdx) in [#1413](#1413) - **(parse)** parse Args without an enclosing CLI by [@jdx](https://github.com/jdx) in [#1419](#1419) ### 🐛 Bug Fixes - **(bash)** preserve colon-prefixed completion words by [@jdx](https://github.com/jdx) in [#1405](#1405) ### 📚 Documentation - write PR titles and descriptions for release notes by [@jdx](https://github.com/jdx) in [#1415](#1415) ### ⚡ Performance - **(cli)** shrink help sorting without allocating cached keys by [@jdx](https://github.com/jdx) in [#1396](#1396) - **(cli)** make advanced help and runtime spec serialization optional by [@jdx](https://github.com/jdx) in [#1399](#1399) - **(cli)** share help sorting and skip unused rendering work by [@jdx](https://github.com/jdx) in [#1400](#1400) - **(cli)** avoid color analysis for plain help by [@jdx](https://github.com/jdx) in [#1401](#1401) ### 🔍 Other Changes - **(ci)** use self-repository workflow references by [@jdx](https://github.com/jdx) in [#1409](#1409) ### 📦️ Dependency Updates - lock file maintenance by [@renovate[bot]](https://github.com/renovate[bot]) in [#1398](#1398) - update jdx/renovate-config digest to 8cabc2e by [@renovate[bot]](https://github.com/renovate[bot]) in [#1406](#1406) - update zizmorcore/zizmor-action action to v0.6.3 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1403](#1403) - update dependency go to v1.27.1 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1407](#1407) - update actions/deploy-pages action to v5 by [@renovate[bot]](https://github.com/renovate[bot]) in [#1404](#1404) - update communique to v1.4.0 by [@jdx](https://github.com/jdx) in [#1416](#1416) ### New Contributors - @lu-zero made their first contribution in [#1414](#1414)
Reduce help-rendering code size while retaining allocation-free unstable sorting:
cargo run -p gate --release --bin time-help).Size
Measured with the oxc migration PR, comparing bpaf on main (
0d31f5865) with the migration (5396b74e1) plus this patch:This patch saves 180,592 B (176.4 KiB) combined versus the migration using released usage-rs 6.8.0. Measurements use Rust 1.98.1, macOS arm64, fat LTO, one codegen unit, allocator enabled, and identical stripping/signing; oxfmt disables default features.
Performance and validation
Local mise help timings ranged from −0.2% to +1.3%; the unchanged KDL control varied by 5%, so these samples do not establish an instruction-count improvement. Sorting adds no cached-key allocation. Oxc help and 719 KB of sampled mise help/KDL output are byte-identical to baseline.
AI-assisted with Codex (GPT-6).
Summary by CodeRabbit