Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Go performance optimization techniques including profiling with pprof, memory optimization, concurrency patterns, and escape analysis.
.claude/skills/aiskillstore-golang-performance/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -2% | 0% |
| case-12 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 117% | 0% |
| case-08 | ✓→✓ | = Same ✓ | 107% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 67% | 0% |
Persona: You are a Go performance engineer. You never optimize without profiling first — measure, hypothesize, change one thing, re-measure.
Thinking mode: Use ultrathink for performance optimization. Shallow analysis misidentifies bottlenecks — deep reasoning ensures the right optimization is applied to the right problem.
Modes:
Dependencies:
go install golang.org/x/perf/cmd/benchstat@latestsamber/cc-skills-golang@golang-troubleshooting skill)Before optimizing Go code, verify the bottleneck is in your process — if 90% of latency is a slow DB query or API call, reducing allocations won't help.
Diagnose: 1- fgprof — captures on-CPU and off-CPU (I/O wait) time; if off-CPU dominates, the bottleneck is external 2- go tool pprof (goroutine profile) — many goroutines blocked in net.(*conn).Read or database/sql = external wait 3- Distributed tracing (OpenTelemetry) — span breakdown shows which upstream is slow
When external: optimize that component instead — query tuning, caching, connection pools, circuit breakers (→ See samber/cc-skills-golang@golang-database skill, Caching Patterns).
samber/cc-skills-golang@golang-benchmark skill)go test -bench=BenchmarkMyFunc -benchmem -count=6 ./pkg/... | tee /tmp/report-1.txtbenchstat /tmp/report-1.txt /tmp/report-2.txt to confirm statistical significanceperf(scope): summary commit typeRefer to library documentation for known patterns before inventing custom solutions. Keep all /tmp/report-*.txt files as an audit trail.
| Bottleneck | Signal (from pprof) | Action | | --- | --- | --- | | Too many allocations | alloc_objects high in heap profile | Memory optimization | | CPU-bound hot loop | function dominates CPU profile | CPU optimization | | GC pauses / OOM | high GC%, container limits | Runtime tuning | | Network / I/O latency | goroutines blocked on I/O | I/O & networking | | Repeated expensive work | same computation/fetch multiple times | Caching patterns | | Wrong algorithm | O(n²) where O(n) exists | Algorithmic complexity | | Lock contention | mutex/block profile hot | → See samber/cc-skills-golang@golang-concurrency skill | | Slow queries | DB time dominates traces | → See samber/cc-skills-golang@golang-database skill |
| Mistake | Fix | | --- | --- | | Optimizing without profiling | Profile with pprof first — intuition is wrong ~80% of the time | | Default http.Client without Transport | MaxIdleConnsPerHost defaults to 2; set to match your concurrency level | | Logging in hot loops | Log calls prevent inlining and allocate even when the level is disabled. Use slog.LogAttrs | | panic/recover as control flow | panic allocates a stack trace and unwinds the stack; use error returns | | unsafe without benchmark proof | Only justified when profiling shows >10% improvement in a verified hot path | | No GC tuning in containers | Set GOMEMLIMIT to 80-90% of container memory to prevent OOM kills | | reflect.DeepEqual in production | 50-200x slower than typed comparison; use slices.Equal, maps.Equal, bytes.Equal |
Automate benchmark comparison in CI to catch regressions before they reach production. → See samber/cc-skills-golang@golang-benchmark skill for benchdiff and cob setup.
samber/cc-skills-golang@golang-benchmark skill for benchmarking methodology, benchstat, and b.Loop() (Go 1.24+)samber/cc-skills-golang@golang-troubleshooting skill for pprof workflow, escape analysis diagnostics, and performance debuggingsamber/cc-skills-golang@golang-data-structures skill for slice/map preallocation and strings.Buildersamber/cc-skills-golang@golang-concurrency skill for worker pools, sync.Pool API, goroutine lifecycle, and lock contentionsamber/cc-skills-golang@golang-safety skill for defer in loops, slice backing array aliasingsamber/cc-skills-golang@golang-database skill for connection pool tuning and batch processingsamber/cc-skills-golang@golang-observability skill for continuous profiling in production| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 37,842 | 30,398 | -20% | 1 | 1 | 0% | 6,373 | 6,253 | -2% | 0 | 0 | — |
case-02 | pass→pass | 51,423 | 43,209 | -16% | 1 | 1 | 0% | 3,701 | 8,045 | +117% | 0 | 0 | — |
case-03 | fail→fail | 32,606 | 29,175 | -11% | 1 | 1 | 0% | 5,006 | 6,297 | +26% | 0 | 0 | — |
case-08 | pass→pass | 13,740 | 17,519 | +28% | 1 | 1 | 0% | 2,208 | 4,571 | +107% | 0 | 0 | — |
case-04 | pass→pass | 18,034 | 19,029 | +6% | 1 | 1 | 0% | 3,004 | 5,005 | +67% | 0 | 0 | — |
case-05 | pass→pass | 17,275 | 15,851 | -8% | 1 | 1 | 0% | 2,938 | 4,494 | +53% | 0 | 0 | — |
case-06 | pass→pass | 14,437 | 9,942 | -31% | 1 | 1 | 0% | 1,684 | 3,478 | +107% | 0 | 0 | — |
case-07 | pass→pass | 11,710 | 10,218 | -13% | 1 | 1 | 0% | 2,008 | 3,538 | +76% | 0 | 0 | — |
case-09 | pass→pass | 23,310 | 14,865 | -36% | 1 | 1 | 0% | 2,651 | 4,077 | +54% | 0 | 0 | — |
case-10 | pass→pass | 18,096 | 18,688 | +3% | 1 | 1 | 0% | 2,549 | 4,824 | +89% | 0 | 0 | — |
case-11 | pass→pass | 11,937 | 6,504 | -46% | 1 | 1 | 0% | 2,046 | 2,817 | +38% | 0 | 0 | — |
case-12 | fail→pass | 17,415 | 6,473 | -63% | 1 | 1 | 0% | 2,810 | 2,696 | -4% | 0 | 0 | — |
case-13 | pass→pass | 17,574 | 24,890 | +42% | 1 | 1 | 0% | 3,015 | 5,299 | +76% | 0 | 0 | — |
case-14 | pass→pass | 17,787 | 23,894 | +34% | 1 | 1 | 0% | 3,248 | 5,396 | +66% | 0 | 0 | — |
case-15 | pass→pass | 16,886 | 15,273 | -10% | 1 | 1 | 0% | 3,247 | 4,587 | +41% | 0 | 0 | — |
case-16 | pass→pass | 14,328 | 9,222 | -36% | 1 | 1 | 0% | 1,963 | 3,356 | +71% | 0 | 0 | — |
case-17 | pass→pass | 14,553 | 18,127 | +25% | 1 | 1 | 0% | 2,148 | 4,789 | +123% | 0 | 0 | — |
case-18 | fail→fail | 16,638 | 15,745 | -5% | 1 | 1 | 0% | 2,864 | 4,310 | +50% | 0 | 0 | — |
case-19 | pass→pass | 17,760 | 11,467 | -35% | 1 | 1 | 0% | 2,360 | 3,216 | +36% | 0 | 0 | — |
case-20 | pass→pass | 3,937 | 2,407 | -39% | 1 | 1 | 0% | 539 | 2,130 | +295% | 0 | 0 | — |
case-21 | pass→pass | 4,991 | 5,274 | +6% | 1 | 1 | 0% | 847 | 2,692 | +218% | 0 | 0 | — |
case-22 | pass→pass | 9,678 | 11,976 | +24% | 1 | 1 | 0% | 1,867 | 3,895 | +109% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/22/2026 | — |
Other measured skills in the registry, with their headline benchmark lift.