Performance
This skill provides systematic performance analysis for the RTK CLI tool, measuring startup time against a <10ms target, memory usage under 5MB, and token savings between 60–90%. It includes baseline capture, regression detection with flamegraph profiling, and common optimization techniques like LazyLock initialization and zero-copy string processing.
Performance skill benchmarks RTK CLI startup time, memory usage, and token savings against defined targets.
AI-generated summary based on this skill's SKILL.md
Install
rtk-ai/rtk/performance · repository language: Rust
git clone https://github.com/rtk-ai/rtk
cp -r rtk/.claude/skills/performance ~/.claude/skills/performanceFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How to benchmark CLI startup time for Performance?
Performance provides systematic measurement of RTK CLI startup time against a <10ms target. Use hyperfine to capture baseline startup metrics, then track results across builds. Performance includes regression detection workflows to identify when changes exceed acceptable thresholds, helping maintain the startup performance goal.
How does Performance optimize Rust binary size and memory?
Performance addresses binary bloat through dependency analysis with cargo and memory optimization techniques. It covers LazyLock initialization patterns for lazy static setup, zero-copy string processing to reduce allocations, and heap profiling with dhat. The skill targets memory usage under 5MB while maintaining functionality.
What token savings can Performance measure in filters?
Performance provides methods to measure token efficiency gains from filter optimizations, tracking savings between 60–90%. The skill includes token measurement techniques to quantify the impact of compression and processing improvements, enabling data-driven decisions on which optimizations deliver the best efficiency returns.
How does Performance detect regressions using profiling tools?
Performance uses flamegraph profiling to identify performance regressions by visualizing CPU hotspots and call patterns. Combined with baseline capture and CI/CD integration, the skill enables continuous regression detection. System call tracing via strace and dtrace helps pinpoint unexpected overhead from dependencies or initialization.
Can Performance set up continuous monitoring in CI/CD?
Performance includes setup guidance for continuous performance monitoring within CI/CD pipelines, with pre-commit performance hook configuration. The skill provides RTK performance targets checklist and regression testing workflows to catch performance degradation early, ensuring startup time, memory, and token goals remain met across releases.
What optimization techniques does Performance teach?
Performance covers LazyLock and zero-copy processing as core optimization techniques, plus regex compilation overhead reduction and dependency bloat analysis. The skill prioritizes optimizations by impact, helping you focus on changes that move closest to <10ms startup and 5MB memory targets while maximizing token savings.
SKILL.md
rendered from the published skill — quoted content, verbatim
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 count_tokens() |
<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:
```bash
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
.claude/skills/performance/SKILL.md