You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(skills): rename skill directories with codspeed prefix
Rename optimize -> codspeed-optimize and setup-harness ->
codspeed-setup-harness for clearer namespacing as plugin skills.
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: skills/codspeed-optimize/SKILL.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
name: optimize
2
+
name: codspeed-optimize
3
3
description: "Autonomously optimize code for performance using CodSpeed benchmarks, flamegraph analysis, and iterative improvement. Use this skill whenever the user wants to make code faster, reduce CPU usage, optimize memory, improve throughput, find performance bottlenecks, or asks to 'optimize', 'speed up', 'make faster', 'reduce latency', 'improve performance', or points at a CodSpeed benchmark result wanting improvements. Also trigger when the user mentions a slow function, a regression, or wants to understand where time is spent in their code."
4
4
---
5
5
@@ -87,6 +87,7 @@ Use the CodSpeed MCP tools to understand where time is spent:
87
87
Apply optimizations one at a time. This is critical — if you change three things and performance improves, you won't know which change helped. If it regresses, you won't know which one hurt.
88
88
89
89
**Important constraints:**
90
+
90
91
- Only change code you've read and understood
91
92
- Preserve correctness — run existing tests after each change
Then compare the walltime run against a walltime baseline using `compare_runs`.
149
150
150
151
**Patterns that often show up in simulation but NOT walltime:**
152
+
151
153
- Iterator adapter overhead (e.g., `.take(n)` to `[..n]`) — branch prediction hides it
152
154
- Bounds check elimination — hardware speculates past them
153
155
- Trivial arithmetic simplifications — hidden by out-of-order execution
154
156
155
157
**Patterns that reliably help in both modes:**
158
+
156
159
- Avoiding type conversions in hot loops (float/integer round-trips)
157
160
- Eliminating libm calls (roundf, sinf — these are software routines)
158
161
- Skipping redundant memory initialization
@@ -165,6 +168,7 @@ If a simulation improvement doesn't show up in walltime, strongly consider rever
165
168
If the user wants more optimization, go back to Step 2 with fresh flamegraphs from your latest run. The profile will have shifted now that you've addressed the top bottleneck, revealing new targets.
166
169
167
170
Keep iterating until:
171
+
168
172
- The user says they're satisfied
169
173
- The flamegraph shows no clear bottleneck (time is spread evenly)
170
174
- Remaining optimizations would require architectural changes the user hasn't approved
@@ -173,28 +177,34 @@ Keep iterating until:
173
177
## Language-specific notes
174
178
175
179
### Rust
180
+
176
181
- Use `cargo codspeed build -m <mode>` to build, `cargo codspeed run` to run
177
182
-`--bench <name>` selects specific benchmark suites (matching `[[bench]]` targets in Cargo.toml)
178
183
- Positional filter after `cargo codspeed run` matches benchmark names (e.g., `cargo codspeed run cat.jpg`)
179
184
- Frameworks: criterion, divan, bencher (all work with cargo-codspeed)
180
185
181
186
### Python
187
+
182
188
- Uses pytest-codspeed: `codspeed run -m simulation -- pytest --codspeed`
Copy file name to clipboardExpand all lines: skills/codspeed-setup-harness/SKILL.md
+30-8Lines changed: 30 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
name: setup-harness
2
+
name: codspeed-setup-harness
3
3
description: "Set up performance benchmarks and CodSpeed harness for a project. Use this skill whenever the user wants to create benchmarks, add performance tests, set up CodSpeed, configure codspeed.yml, integrate a benchmarking framework (criterion, divan, pytest-benchmark, vitest bench, go test -bench, google benchmark), or when the user says 'add benchmarks', 'set up perf tests', 'create a benchmark', 'benchmark this', or wants to measure performance of their code for the first time. Also trigger when the optimize skill needs benchmarks that don't exist yet."
4
4
---
5
5
@@ -27,13 +27,13 @@ Based on the language and what the user wants to benchmark, pick the right harne
27
27
28
28
These integrate deeply with CodSpeed and provide per-benchmark flamegraphs, fine-grained comparison, and simulation mode support.
29
29
30
-
| Language | Framework | How to set up |
31
-
|----------|-----------|---------------|
32
-
|**Rust**| divan (recommended), criterion, bencher | Add `codspeed-<framework>-compat` as dependency using `cargo add --rename`|
33
-
|**Python**| pytest-benchmark | Install `pytest-codspeed`, use `@pytest.benchmark` or `benchmark` fixture |
0 commit comments