go-performance-testing
Design, run, compare, and interpret Go performance evidence using benchmarks, B.Loop, benchstat, pprof, traces, escape analysis, cache locality, false sharing, sync.Pool, GC limits, container CPU behavior, and PGO. Use when investigating Go latency, throughput, CPU, memory, allocations, contention, runtime behavior, performance regressions, or optimization claims.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- go-performance-testing
- license
- MIT
- metadata
- { "tags": "go,golang,benchmarks,profiling,pprof,performance", "version": "0.2.0", "category": "Go", "displayName": "Go Performance Testing" }
- description
- Design, run, compare, and interpret Go performance evidence using benchmarks, B.Loop, benchstat, pprof, traces, escape analysis, cache locality, false sharing, sync.Pool, GC limits, container CPU behavior, and PGO. Use when investigating Go latency, throughput, CPU, memory, allocations, contention, runtime behavior, performance regressions, or optimization claims.
- compatibility
- Codex, Claude Code, and other Agent Skills-compatible clients.
02 资源文件 8
- 参考文档agents/openai.yaml233 B
- 参考文档guidelines.md1.2 KB
- 参考文档references/performance-testing/examples.md1.8 KB
- 参考文档references/performance-testing/knowledge.md3.0 KB
- 参考文档references/performance-testing/rules.md2.8 KB
- 参考文档workflows/benchmark-code.md966 B
- 参考文档workflows/evaluate-pgo.md1.4 KB
- 参考文档workflows/investigate-performance.md1.1 KB
03 SKILL.md 正文
Go Performance Testing
Optimize only after establishing a representative, repeatable measurement and a specific hypothesis.
Core Workflow
- Define the user-visible metric and representative workload.
- Stabilize correctness before measuring performance.
- Write focused benchmarks with realistic inputs and controlled setup.
- Collect repeated baseline samples in comparable conditions.
- Use allocations, profiles, and traces to form a causal hypothesis.
- Make one bounded change.
- Compare repeated before/after samples statistically.
- Recheck correctness and the end-to-end workload.
Read Next
| Task | Load |
|---|---|
| Benchmark a function or package | guidelines.md, workflows/benchmark-code.md |
| Investigate a regression | workflows/investigate-performance.md |
| Evaluate profile-guided optimization | workflows/evaluate-pgo.md |
| Choose benchmark and profile controls | references/performance-testing/rules.md |
| Interpret metrics and profiles | references/performance-testing/knowledge.md |
| Review benchmark patterns | references/performance-testing/examples.md |
Guardrails
- Do not optimize from one benchmark line or an unrepresentative microbenchmark.
- Do not compare runs made under materially different environments.
- Do not treat coverage or race detection as performance evidence.
- Name the profile sample type and distinguish flat from cumulative cost.
- Prefer
B.Looponly when the pinned Go version supports it. - Keep production profile endpoints protected and operationally controlled.
- Do not encode cache-line size, escape output, or inliner budgets as portable facts.
- Do not use
sync.Poolas a cache or resource owner.
Source Notes
Guidance is transformed and paraphrased from Inanc Gumus, Go by Example: Programmer's Guide to Idiomatic and Testable Programs (Manning, 2025), especially Chapter 3. Examples are original.
Diagnostics, locality, allocation, GC, and container guidance also incorporates transformed material from Teiva Harsanyi, 100 Go Mistakes and How to Avoid Them (Manning, 2022), Chapter 12.
Book: https://www.manning.com/books/go-by-example
Verify current behavior against https://pkg.go.dev/testing, https://go.dev/doc/diagnostics, and https://go.dev/doc/pgo.
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.