What problem does it solve?
This Skill addresses the critical need to optimize software performance by providing methodologies and tools for benchmarking, profiling, and applying advanced optimization techniques across different programming languages.
Core Features & Use Cases
- Benchmarking: Implement robust benchmarking in Rust (criterion) and Python (time.perf_counter) to measure performance accurately.
- Profile-Guided Optimization (PGO): Guide Rust compiler optimizations using real-world workloads.
- Batch Dispatch: Reduce overhead by processing items in batches, especially across FFI boundaries.
- Serialization Strategies: Choose the most efficient serialization format (Arrow, msgspec, bincode, JSON) based on use case.
- Cache Optimization: Improve data locality and reduce cache misses through proper data layout and alignment.
- Profiling: Utilize system and language-specific tools (perf, py-spy, flamegraph) to identify performance bottlenecks.
- Use Case: When developing a high-throughput microservice in Rust, use this Skill to establish performance baselines with criterion, identify hot paths with flamegraph, and apply PGO for significant speedups.
Quick Start
Use the performance-patterns skill to benchmark a Rust function using criterion and save the baseline.