What problem does it solve?
This Skill helps locate and remove performance bottlenecks in C++ code by focusing on data locality, unnecessary heap allocations, and inefficient data layout, turning vague slowdowns into measurable improvements.
Core Features & Use Cases
- Allocation minimization: count and reduce heap allocations by reserving capacity, using stack storage or small string optimizations.
- Data locality and layout: prefer contiguous containers, reorder struct members to reduce padding, and flatten pointer-chasing graphs to improve cache friendliness.
- Measurement-driven optimization: use microbenchmarks and profilers to identify hotspots before making changes.
- Use Case: Improve a simulation or server that suffers from cache misses and allocation churn by converting linked structures to contiguous layouts, reducing allocations, and validating improvements with benchmarks.
Quick Start
Analyze my hot function for cache misses, count allocations, and recommend data layout and allocation changes with concrete microbenchmark suggestions.