Agent skill · software engineering · rtk-ai
performance
CLI performance optimization - startup time, memory usage, token savings benchmarking
Why this skill is useful
Provides specific benchmarking scripts and performance optimization workflows for the RTK CLI tool that are not commonly known.
What it needs
Requires cargo installed locally. About 7k tokens when loaded. Last updated 2026-08-06. 75,070 stars on the source repository.
What this skill does
Performance Optimization Skill Systematic performance analysis and optimization for RTK CLI tool, focusing on startup time (<10ms), memory usage (<5MB), and token savings (60-90%). When to Use Automatically triggered: After filter changes, regex modifications, or dependency additions Manual invocation: When performance degradation suspected or before release Proactive: After any code change that could impact startup time or memory RTK Performance Targets Metric Target Verification Method Failure Threshold -------- -------- --------------------- ------------------- Startup time <10ms hyperfine 'rtk <cmd>' >15ms = blocker Memory usage <5MB resident /usr/bin/time -l rtk <cmd> (macOS) >7MB = blocker Token savings 60-90% Tests with counttokens() <60% = blocker Binary size <5MB stripped ls -lh target/release/rtk >8MB = investigate Performance Analysis Workflow 1. Establish Baseline Before making any changes, capture current performance: 2. Make Changes Implement optimization or feature changes. 3. Rebuild and Measure 4. Compare Results 5. Identify Regressions Startup time regression (>15% increase or >2ms absolute): Memory regression (>20% increase or >1MB absolute): Token savings regression (<60% savings): Common Performance Issues Issue 1: Regex Recompilation Symptom: Startup time >20ms, flamegraph shows regex compilation in hot path Detection: Fix: Issue 2: Excessive Allocations Symptom: Memory usage >5MB, many small allocations in flamegraph Detection: Fix: Issue 3: Startup I/O Symptom: Startup time varies wildly (5ms to 50ms), flamegraph shows file reads Detection: Fix: Issue 4: Dependency Bloat Symptom: Binary size >5MB, many unused dependencies in Cargo.toml Detection: Fix: Optimization Techniques Technique 1: LazyLock Initialization Use case: Regex patterns, static configuration, one-time allocations Implementation: Impact: ~5-10ms saved per regex pattern (if compiled at runtime) Technique 2: Zero-Copy String Processing Use case: Filter output without allocating i …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills rtk-ai/performance