← ClaudeAtlas

golang-benchmarklisted

Design, run, and interpret Go benchmarks, profiles, traces, and compiler diagnostics. Use when measuring a performance question, comparing implementations, or investigating a specific runtime cost.
reagin/agent-skills · ★ 0 · Testing & QA · score 63
Install: claude install-skill reagin/agent-skills
# Go Benchmarking Produce evidence that is reproducible enough to support the requested decision. Keep measurement and optimization as separate, independently verified steps. ## Start with the project Before writing or running anything: 1. Read `go.mod`, repository instructions, existing `Benchmark*` functions, performance tests, and documented commands. 2. Identify the decision, workload, metric, and correctness condition. Latency, throughput, allocations, peak memory, and contention answer different questions. 3. Reuse the project's benchmark fixtures and tooling. If an optional analysis tool is unavailable, report that before changing the environment. 4. Keep the scope narrow enough that setup, unrelated tests, I/O, or shared infrastructure do not dominate the signal. ## Measurement workflow 1. Establish a baseline before changing code. 2. Write a representative benchmark with deterministic inputs and setup outside the timed region. 3. Confirm the benchmark still exercises the intended result; guard against dead-code elimination and accidental caching. 4. Run multiple samples under comparable conditions. Avoid concurrent benchmark jobs on the same constrained machine. 5. Change one relevant variable, repeat with the same command and environment, then compare distributions rather than isolated numbers. 6. Use a profile or compiler diagnostic only when it answers a specific unresolved question. 7. Re-run correctness tests after any optimization. Prefer `b.Loop()` when