[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CFGN9ZPN1ACGE1A883P7H2":3,"skill-same:01M6CFGN9ZPN1ACGE1A883P7H2":121},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":63,"commitSha":64,"skillDirectory":65,"forksCount":66,"repositoryHtmlUrl":67,"repositoryHomepageUrl":6,"ownerHtmlUrl":68,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":69,"install":70,"resources":82},"01M6CFGN9ZPN1ACGE1A883P7H2","golang-benchmark",null,"Golang benchmarking, profiling, and performance measurement. Use when writing, running, or comparing Go benchmarks, profiling hot paths with pprof, interpreting CPU\u002Fmemory\u002Ftrace profiles, analyzing results with benchstat, setting up CI benchmark regression detection, or investigating production performance with Prometheus runtime metrics. Also use when the developer needs deep analysis on a specific performance indicator - this skill provides the measurement methodology, while `golang-performance` provides the optimization patterns.","rockcookies\u002Fskills","rockcookies","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3498265?v=4","01M6CF9C16X3SDSKZX6ANH7HQM","Jacob He","01M6CF9C53JP821FCW6R9B00AJ",1,"MIT","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"golang benchmark","benchmark","golang","analysis","context7","up","edit","write","read","regression","projects","Bash","MCP","ci","code","deep analysis","benchmarking","performance","memory","writing","2026-11-10 10:12:30",false,"---\nname: golang-benchmark\ndescription: >-\n  Golang benchmarking, profiling, and performance measurement. Use when writing,\n  running, or comparing Go benchmarks, profiling hot paths with pprof,\n  interpreting CPU\u002Fmemory\u002Ftrace profiles, analyzing results with benchstat,\n  setting up CI benchmark regression detection, or investigating production\n  performance with Prometheus runtime metrics. Also use when the developer needs\n  deep analysis on a specific performance indicator - this skill provides the\n  measurement methodology, while `golang-performance` provides the optimization\n  patterns.\nuser-invocable: true\nlicense: MIT\ncompatibility: >-\n  Designed for Claude Code, Codex or similar harness, and for projects using\n  Golang.\nmetadata:\n  author: samber\n  version: 1.3.0\n  openclaw:\n    emoji: ?\n    homepage: https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang\n    requires:\n      bins:\n        - go\n        - benchstat\n    install:\n      - kind: go\n        package: golang.org\u002Fx\u002Fperf\u002Fcmd\u002Fbenchstat@latest\n        bins:\n          - benchstat\nallowed-tools: >-\n  Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent\n  WebFetch Bash(benchstat:*) Bash(benchdiff:*) Bash(cob:*) Bash(gobenchdata:*)\n  Bash(curl:*) mcp__context7__resolve-library-id mcp__context7__query-docs\n  WebSearch AskUserQuestion EnterWorktree ExitWorktree\npaths:\n  - '**\u002F*.go'\n---\n\n**Persona:** You are a Go performance measurement engineer. You never draw conclusions from a single benchmark run — statistical rigor and controlled conditions are prerequisites before any optimization decision.\n\n**Thinking mode:** Reason as thoroughly as possible for benchmark analysis, profile interpretation, and performance comparison tasks — deep reasoning prevents misinterpreting profiling data and ensures statistically sound conclusions. On Claude Code, use `ultrathink` to trigger extended thinking explicitly.\n\n**Dependencies:**\n\n- benchstat: `go install golang.org\u002Fx\u002Fperf\u002Fcmd\u002Fbenchstat@latest`\n\n# Go Benchmarking & Performance Measurement\n\nPerformance improvement does not exist without measures — if you can measure it, you can improve it.\n\nThis skill covers the full measurement workflow: write a benchmark, run it, profile the result, compare before\u002Fafter with statistical rigor, and track regressions in CI. For optimization patterns to apply after measurement, → See `golang-performance` skill. For pprof setup on running services, → See `golang-troubleshooting` skill.\n\n## Writing Benchmarks\n\n### File and Ordering Conventions\n\nBenchmark functions live in a `_bench_test.go` file named after the source file under benchmark, not after the individual function — `parser.go` -> `parser_bench_test.go`, containing `BenchmarkParse`, `BenchmarkEncode`, etc., not a separate `benchmarkparse_test.go` per function. Keeping benchmarks in their own file (instead of mixed into `parser_test.go`) keeps `go test -bench=. .\u002Fpkg\u002Fparser` output free of unrelated `Test*` noise, and separates fixtures sized for measurement (large inputs, long-lived setup) from those sized for correctness — the two rarely share the same shape. The file still follows Go's one-test-file-per-source-file convention (→ See `golang-testing` skill), just with the `_bench` suffix marking its narrower purpose.\n\nOrder `Benchmark*` functions inside `parser_bench_test.go` to mirror the order of the functions\u002Fmethods they measure in `parser.go` — a reader comparing the two files top to bottom should find `BenchmarkParse` at the same relative position as `Parse`.\n\n### `b.Loop()` (Go 1.24+) — preferred\n\nFor Go 1.24+, prefer `b.Loop()` for new benchmarks. It times only the loop body and keeps function arguments\u002Fresults alive, which reduces dead-code-elimination mistakes.\n\n```go\nfunc BenchmarkParse(b *testing.B) {\n    data := loadFixture(\"large.json\") \u002F\u002F setup — excluded from timing\n    for b.Loop() {\n        Parse(data)  \u002F\u002F compiler cannot eliminate this call\n    }\n}\n```\n\nLegacy `b.N` loops still compile and are fine to keep when preserving existing benchmarks or supporting Go \u003C1.24. They are easier to get wrong: setup may need `b.ResetTimer()`, and results may need a sink if the compiler can eliminate the work. Go 1.26 fixed an earlier `b.Loop()` inlining limitation — benchmarks on 1.24–1.25 already benefit from `b.Loop()` but may miss inlining optimizations that 1.26 delivers.\n\n### Memory tracking\n\n```go\nfunc BenchmarkAlloc(b *testing.B) {\n    b.ReportAllocs() \u002F\u002F or run with -benchmem flag\n    var sink []byte\n    for b.Loop() {\n        sink = make([]byte, 1024)\n    }\n    _ = sink\n}\n```\n\n`b.ReportMetric()` adds custom metrics (e.g., throughput):\n\n```go\nb.ReportMetric(float64(totalBytes)\u002Fb.Elapsed().Seconds(), \"bytes\u002Fs\") \u002F\u002F b.Elapsed() is only valid inside b.Loop()\n```\n\n### Sub-benchmarks and table-driven\n\n```go\nfunc BenchmarkEncode(b *testing.B) {\n    for _, size := range []int{64, 256, 4096} {\n        b.Run(fmt.Sprintf(\"size=%d\", size), func(b *testing.B) {\n            data := make([]byte, size)\n            for b.Loop() {\n                Encode(data)\n            }\n        })\n    }\n}\n```\n\n## Running Benchmarks\n\n```bash\ngo test -bench=BenchmarkEncode -benchmem -count=10 .\u002Fpkg\u002F... | tee bench.txt\n```\n\n| Flag                   | Purpose                                   |\n| ---------------------- | ----------------------------------------- |\n| `-bench=.`             | Run all benchmarks (regexp filter)        |\n| `-benchmem`            | Report allocations (B\u002Fop, allocs\u002Fop)      |\n| `-count=10`            | Run 10 times for statistical significance |\n| `-benchtime=3s`        | Minimum time per benchmark (default 1s)   |\n| `-cpu=1,2,4`           | Run with different GOMAXPROCS values      |\n| `-cpuprofile=cpu.prof` | Write CPU profile                         |\n| `-memprofile=mem.prof` | Write memory profile                      |\n| `-trace=trace.out`     | Write execution trace                     |\n\n**Output format:** `BenchmarkEncode\u002Fsize=64-8  5000000  230.5 ns\u002Fop  128 B\u002Fop  2 allocs\u002Fop` — the `-8` suffix is GOMAXPROCS, `ns\u002Fop` is time per operation, `B\u002Fop` is bytes allocated per op, `allocs\u002Fop` is heap allocation count per op.\n\n## Comparing Optimization Variants in Parallel\n\nWhen several competing optimization hypotheses exist for the same bottleneck, implement each variant in its own isolated worktree via a separate sub-agent, so their code changes never collide in the shared working tree.\n\n**Run the benchmarks serially, not concurrently.** Concurrent benchmark runs share the same CPU — the noisy-neighbor effect contaminates `ns\u002Fop` and reintroduces the exact statistical noise `-count` and `benchstat` exist to eliminate. Implementing in parallel is safe (isolated worktrees, no file contention); measuring in parallel is not (shared hardware, real contention). Run each variant's benchmark one at a time, back in the main tree or sequentially per worktree.\n\nCompare every variant's `benchstat` output against the **same** baseline report, keep the winner, and remove the worktrees for the rest.\n\n## Documenting Results in Commits\n\nPaste benchstat output in the commit body when the change has a measurable performance impact. This documents _why_ an optimization was made, prevents future readers from reverting it, and lets reviewers verify the claim without re-running benchmarks.\n\nCommit format:\n\n```\nperf(parser): reduce Parse allocations 50% with sync.Pool\n\nReplace per-call []byte allocation with a pooled buffer.\n\ngoos: linux \u002F goarch: amd64 \u002F cpu: AMD Ryzen 9 5950X\n          │    old     │              new               │\n          │  sec\u002Fop    │  sec\u002Fop     vs base            │\nParse-32    4.592µ ± 2%  3.041µ ± 1%  -33.78% (p=0.000 n=10)\n\n          │   old    │             new              │\n          │   B\u002Fop   │   B\u002Fop     vs base           │\nParse-32   1.024Ki ± 0%  0.512Ki ± 0%  -50.00% (p=0.000 n=10)\n\n          │ old  │            new             │\n          │ allocs\u002Fop │ allocs\u002Fop  vs base    │\nParse-32   12.00 ± 0%   6.000 ± 0%  -50.00% (p=0.000 n=10)\n```\n\n**Rules:**\n\n- Only include benchmarks directly affected by the change — strip unrelated rows\n- Never paste results with `~` (no statistical significance) — the improvement cannot be claimed\n- Include the hardware context line (`goos\u002Fgoarch\u002Fcpu`) so results are reproducible\n- Use `perf(scope):` commit type for performance-only changes\n\n## Profiling from Benchmarks\n\nGenerate profiles directly from benchmark runs — no HTTP server needed:\n\n```bash\n# CPU profile\ngo test -bench=BenchmarkParse -cpuprofile=cpu.prof .\u002Fpkg\u002Fparser\ngo tool pprof cpu.prof\n\n# Memory profile (alloc_objects shows GC churn, inuse_space shows leaks)\ngo test -bench=BenchmarkParse -memprofile=mem.prof .\u002Fpkg\u002Fparser\ngo tool pprof -alloc_objects mem.prof\n\n# Execution trace\ngo test -bench=BenchmarkParse -trace=trace.out .\u002Fpkg\u002Fparser\ngo tool trace trace.out\n```\n\nFor full pprof CLI reference (all commands, non-interactive mode, profile interpretation), see [pprof Reference](.\u002Freferences\u002Fpprof.md). For execution trace interpretation, see [Trace Reference](.\u002Freferences\u002Ftrace.md). For statistical comparison, see [benchstat Reference](.\u002Freferences\u002Fbenchstat.md).\n\n## Reference Files\n\n- **[pprof Reference](.\u002Freferences\u002Fpprof.md)** — Interactive and non-interactive analysis of CPU, memory, and goroutine profiles. Full CLI commands, profile types (CPU vs alloc*objects vs inuse_space), web UI navigation, and interpretation patterns. Use this to dive deep into \\_where* time and memory are being spent in your code.\n\n- **[benchstat Reference](.\u002Freferences\u002Fbenchstat.md)** — Statistical comparison of benchmark runs with rigorous confidence intervals and p-value tests. Covers output reading, filtering old benchmarks, interleaving results for visual clarity, and regression detection. Use this when you need to prove a change made a meaningful performance difference, not just a lucky run.\n\n- **[Trace Reference](.\u002Freferences\u002Ftrace.md)** — Execution tracer for understanding _when_ and _why_ code runs. Visualizes goroutine scheduling, garbage collection phases, network blocking, and custom span annotations. Use this when pprof (which shows _where_ CPU goes) isn't enough — you need to see the timeline of what happened.\n\n- **[Diagnostic Tools](.\u002Freferences\u002Ftools.md)** — Quick reference for ancillary tools: fieldalignment (struct padding waste), GODEBUG (runtime logging flags), fgprof (frame graph profiles), race detector (concurrency bugs), and others. Use this when you have a specific symptom and need a focused diagnostic — don't reach for pprof if a simpler tool already answers your question.\n\n- **[Compiler Analysis](.\u002Freferences\u002Fcompiler-analysis.md)** — Low-level compiler optimization insights: escape analysis (when values move to the heap), inlining decisions (which function calls are eliminated), SSA dump (intermediate representation), and assembly output. Use this when benchmarks show allocations you didn't expect, or when you want to verify the compiler did what you intended.\n\n- **[CI Regression Detection](.\u002Freferences\u002Fci-regression.md)** — Automated performance regression gating in CI pipelines. Covers three tools (benchdiff for quick PR comparisons, cob for strict threshold-based gating, gobenchdata for long-term trend dashboards), noisy neighbor mitigation strategies (why cloud CI benchmarks vary 5-10% even on quiet machines), and self-hosted runner tuning to make benchmarks reproducible. Use this when you want to ensure pull requests don't silently slow down your codebase — detecting regressions early prevents shipping performance debt.\n\n- **[Investigation Session](.\u002Freferences\u002Finvestigation-session.md)** — Production performance troubleshooting workflow combining Prometheus runtime metrics (heap size, GC frequency, goroutine counts), PromQL queries to correlate metrics with code changes, runtime configuration flags (GODEBUG env vars to enable GC logging), and cost warnings (when you're hitting performance tax). Use this when production benchmarks look good but real traffic behaves differently.\n\n- **[Prometheus Go Metrics Reference](.\u002Freferences\u002Fprometheus-go-metrics.md)** — Complete listing of Go runtime metrics actually exposed as Prometheus metrics by `prometheus\u002Fclient_golang`. Covers 30 default metrics, 40+ optional metrics (Go 1.17+), process metrics, and common PromQL queries. Distinguishes between `runtime\u002Fmetrics` (Go internal data) and Prometheus metrics (what you scrape from `\u002Fmetrics`). Use this when setting up monitoring dashboards or writing PromQL queries for production alerts.\n\n## Cross-References\n\n- → See `golang-performance` skill for optimization patterns to apply after measuring (\"if X bottleneck, apply Y\")\n- → See `golang-troubleshooting` skill for pprof setup on running services (enable, secure, capture), Delve debugger, GODEBUG flags, root cause methodology\n- → See `golang-observability` skill for everyday always-on monitoring, continuous profiling (Pyroscope), distributed tracing (OpenTelemetry)\n- → See `golang-testing` skill for general testing practices\n- → See `samber\u002Fcc-skills@promql-cli` skill for querying Prometheus runtime metrics in production to validate benchmark findings\n","**Persona:** You are a Go performance measurement engineer. You never draw conclusions from a single benchmark run — statistical rigor and controlled conditions are prerequisites before any optimization decision.\n\n**Thinking mode:** Reason as thoroughly as possible for benchmark analysis, profile interpretation, and performance comparison tasks — deep reasoning prevents misinterpreting profiling data and ensures statistically sound conclusions. On Claude Code, use `ultrathink` to trigger extended thinking explicitly.\n\n**Dependencies:**\n\n- benchstat: `go install golang.org\u002Fx\u002Fperf\u002Fcmd\u002Fbenchstat@latest`\n\n# Go Benchmarking & Performance Measurement\n\nPerformance improvement does not exist without measures — if you can measure it, you can improve it.\n\nThis skill covers the full measurement workflow: write a benchmark, run it, profile the result, compare before\u002Fafter with statistical rigor, and track regressions in CI. For optimization patterns to apply after measurement, → See `golang-performance` skill. For pprof setup on running services, → See `golang-troubleshooting` skill.\n\n## Writing Benchmarks\n\n### File and Ordering Conventions\n\nBenchmark functions live in a `_bench_test.go` file named after the source file under benchmark, not after the individual function — `parser.go` -> `parser_bench_test.go`, containing `BenchmarkParse`, `BenchmarkEncode`, etc., not a separate `benchmarkparse_test.go` per function. Keeping benchmarks in their own file (instead of mixed into `parser_test.go`) keeps `go test -bench=. .\u002Fpkg\u002Fparser` output free of unrelated `Test*` noise, and separates fixtures sized for measurement (large inputs, long-lived setup) from those sized for correctness — the two rarely share the same shape. The file still follows Go's one-test-file-per-source-file convention (→ See `golang-testing` skill), just with the `_bench` suffix marking its narrower purpose.\n\nOrder `Benchmark*` functions inside `parser_bench_test.go` to mirror the order of the functions\u002Fmethods they measure in `parser.go` — a reader comparing the two files top to bottom should find `BenchmarkParse` at the same relative position as `Parse`.\n\n### `b.Loop()` (Go 1.24+) — preferred\n\nFor Go 1.24+, prefer `b.Loop()` for new benchmarks. It times only the loop body and keeps function arguments\u002Fresults alive, which reduces dead-code-elimination mistakes.\n\n```go\nfunc BenchmarkParse(b *testing.B) {\n    data := loadFixture(\"large.json\") \u002F\u002F setup — excluded from timing\n    for b.Loop() {\n        Parse(data)  \u002F\u002F compiler cannot eliminate this call\n    }\n}\n```\n\nLegacy `b.N` loops still compile and are fine to keep when preserving existing benchmarks or supporting Go \u003C1.24. They are easier to get wrong: setup may need `b.ResetTimer()`, and results may need a sink if the compiler can eliminate the work. Go 1.26 fixed an earlier `b.Loop()` inlining limitation — benchmarks on 1.24–1.25 already benefit from `b.Loop()` but may miss inlining optimizations that 1.26 delivers.\n\n### Memory tracking\n\n```go\nfunc BenchmarkAlloc(b *testing.B) {\n    b.ReportAllocs() \u002F\u002F or run with -benchmem flag\n    var sink []byte\n    for b.Loop() {\n        sink = make([]byte, 1024)\n    }\n    _ = sink\n}\n```\n\n`b.ReportMetric()` adds custom metrics (e.g., throughput):\n\n```go\nb.ReportMetric(float64(totalBytes)\u002Fb.Elapsed().Seconds(), \"bytes\u002Fs\") \u002F\u002F b.Elapsed() is only valid inside b.Loop()\n```\n\n### Sub-benchmarks and table-driven\n\n```go\nfunc BenchmarkEncode(b *testing.B) {\n    for _, size := range []int{64, 256, 4096} {\n        b.Run(fmt.Sprintf(\"size=%d\", size), func(b *testing.B) {\n            data := make([]byte, size)\n            for b.Loop() {\n                Encode(data)\n            }\n        })\n    }\n}\n```\n\n## Running Benchmarks\n\n```bash\ngo test -bench=BenchmarkEncode -benchmem -count=10 .\u002Fpkg\u002F... | tee bench.txt\n```\n\n| Flag                   | Purpose                                   |\n| ---------------------- | ----------------------------------------- |\n| `-bench=.`             | Run all benchmarks (regexp filter)        |\n| `-benchmem`            | Report allocations (B\u002Fop, allocs\u002Fop)      |\n| `-count=10`            | Run 10 times for statistical significance |\n| `-benchtime=3s`        | Minimum time per benchmark (default 1s)   |\n| `-cpu=1,2,4`           | Run with different GOMAXPROCS values      |\n| `-cpuprofile=cpu.prof` | Write CPU profile                         |\n| `-memprofile=mem.prof` | Write memory profile                      |\n| `-trace=trace.out`     | Write execution trace                     |\n\n**Output format:** `BenchmarkEncode\u002Fsize=64-8  5000000  230.5 ns\u002Fop  128 B\u002Fop  2 allocs\u002Fop` — the `-8` suffix is GOMAXPROCS, `ns\u002Fop` is time per operation, `B\u002Fop` is bytes allocated per op, `allocs\u002Fop` is heap allocation count per op.\n\n## Comparing Optimization Variants in Parallel\n\nWhen several competing optimization hypotheses exist for the same bottleneck, implement each variant in its own isolated worktree via a separate sub-agent, so their code changes never collide in the shared working tree.\n\n**Run the benchmarks serially, not concurrently.** Concurrent benchmark runs share the same CPU — the noisy-neighbor effect contaminates `ns\u002Fop` and reintroduces the exact statistical noise `-count` and `benchstat` exist to eliminate. Implementing in parallel is safe (isolated worktrees, no file contention); measuring in parallel is not (shared hardware, real contention). Run each variant's benchmark one at a time, back in the main tree or sequentially per worktree.\n\nCompare every variant's `benchstat` output against the **same** baseline report, keep the winner, and remove the worktrees for the rest.\n\n## Documenting Results in Commits\n\nPaste benchstat output in the commit body when the change has a measurable performance impact. This documents _why_ an optimization was made, prevents future readers from reverting it, and lets reviewers verify the claim without re-running benchmarks.\n\nCommit format:\n\n```\nperf(parser): reduce Parse allocations 50% with sync.Pool\n\nReplace per-call []byte allocation with a pooled buffer.\n\ngoos: linux \u002F goarch: amd64 \u002F cpu: AMD Ryzen 9 5950X\n          │    old     │              new               │\n          │  sec\u002Fop    │  sec\u002Fop     vs base            │\nParse-32    4.592µ ± 2%  3.041µ ± 1%  -33.78% (p=0.000 n=10)\n\n          │   old    │             new              │\n          │   B\u002Fop   │   B\u002Fop     vs base           │\nParse-32   1.024Ki ± 0%  0.512Ki ± 0%  -50.00% (p=0.000 n=10)\n\n          │ old  │            new             │\n          │ allocs\u002Fop │ allocs\u002Fop  vs base    │\nParse-32   12.00 ± 0%   6.000 ± 0%  -50.00% (p=0.000 n=10)\n```\n\n**Rules:**\n\n- Only include benchmarks directly affected by the change — strip unrelated rows\n- Never paste results with `~` (no statistical significance) — the improvement cannot be claimed\n- Include the hardware context line (`goos\u002Fgoarch\u002Fcpu`) so results are reproducible\n- Use `perf(scope):` commit type for performance-only changes\n\n## Profiling from Benchmarks\n\nGenerate profiles directly from benchmark runs — no HTTP server needed:\n\n```bash\n# CPU profile\ngo test -bench=BenchmarkParse -cpuprofile=cpu.prof .\u002Fpkg\u002Fparser\ngo tool pprof cpu.prof\n\n# Memory profile (alloc_objects shows GC churn, inuse_space shows leaks)\ngo test -bench=BenchmarkParse -memprofile=mem.prof .\u002Fpkg\u002Fparser\ngo tool pprof -alloc_objects mem.prof\n\n# Execution trace\ngo test -bench=BenchmarkParse -trace=trace.out .\u002Fpkg\u002Fparser\ngo tool trace trace.out\n```\n\nFor full pprof CLI reference (all commands, non-interactive mode, profile interpretation), see [pprof Reference](.\u002Freferences\u002Fpprof.md). For execution trace interpretation, see [Trace Reference](.\u002Freferences\u002Ftrace.md). For statistical comparison, see [benchstat Reference](.\u002Freferences\u002Fbenchstat.md).\n\n## Reference Files\n\n- **[pprof Reference](.\u002Freferences\u002Fpprof.md)** — Interactive and non-interactive analysis of CPU, memory, and goroutine profiles. Full CLI commands, profile types (CPU vs alloc*objects vs inuse_space), web UI navigation, and interpretation patterns. Use this to dive deep into \\_where* time and memory are being spent in your code.\n\n- **[benchstat Reference](.\u002Freferences\u002Fbenchstat.md)** — Statistical comparison of benchmark runs with rigorous confidence intervals and p-value tests. Covers output reading, filtering old benchmarks, interleaving results for visual clarity, and regression detection. Use this when you need to prove a change made a meaningful performance difference, not just a lucky run.\n\n- **[Trace Reference](.\u002Freferences\u002Ftrace.md)** — Execution tracer for understanding _when_ and _why_ code runs. Visualizes goroutine scheduling, garbage collection phases, network blocking, and custom span annotations. Use this when pprof (which shows _where_ CPU goes) isn't enough — you need to see the timeline of what happened.\n\n- **[Diagnostic Tools](.\u002Freferences\u002Ftools.md)** — Quick reference for ancillary tools: fieldalignment (struct padding waste), GODEBUG (runtime logging flags), fgprof (frame graph profiles), race detector (concurrency bugs), and others. Use this when you have a specific symptom and need a focused diagnostic — don't reach for pprof if a simpler tool already answers your question.\n\n- **[Compiler Analysis](.\u002Freferences\u002Fcompiler-analysis.md)** — Low-level compiler optimization insights: escape analysis (when values move to the heap), inlining decisions (which function calls are eliminated), SSA dump (intermediate representation), and assembly output. Use this when benchmarks show allocations you didn't expect, or when you want to verify the compiler did what you intended.\n\n- **[CI Regression Detection](.\u002Freferences\u002Fci-regression.md)** — Automated performance regression gating in CI pipelines. Covers three tools (benchdiff for quick PR comparisons, cob for strict threshold-based gating, gobenchdata for long-term trend dashboards), noisy neighbor mitigation strategies (why cloud CI benchmarks vary 5-10% even on quiet machines), and self-hosted runner tuning to make benchmarks reproducible. Use this when you want to ensure pull requests don't silently slow down your codebase — detecting regressions early prevents shipping performance debt.\n\n- **[Investigation Session](.\u002Freferences\u002Finvestigation-session.md)** — Production performance troubleshooting workflow combining Prometheus runtime metrics (heap size, GC frequency, goroutine counts), PromQL queries to correlate metrics with code changes, runtime configuration flags (GODEBUG env vars to enable GC logging), and cost warnings (when you're hitting performance tax). Use this when production benchmarks look good but real traffic behaves differently.\n\n- **[Prometheus Go Metrics Reference](.\u002Freferences\u002Fprometheus-go-metrics.md)** — Complete listing of Go runtime metrics actually exposed as Prometheus metrics by `prometheus\u002Fclient_golang`. Covers 30 default metrics, 40+ optional metrics (Go 1.17+), process metrics, and common PromQL queries. Distinguishes between `runtime\u002Fmetrics` (Go internal data) and Prometheus metrics (what you scrape from `\u002Fmetrics`). Use this when setting up monitoring dashboards or writing PromQL queries for production alerts.\n\n## Cross-References\n\n- → See `golang-performance` skill for optimization patterns to apply after measuring (\"if X bottleneck, apply Y\")\n- → See `golang-troubleshooting` skill for pprof setup on running services (enable, secure, capture), Delve debugger, GODEBUG flags, root cause methodology\n- → See `golang-observability` skill for everyday always-on monitoring, continuous profiling (Pyroscope), distributed tracing (OpenTelemetry)\n- → See `golang-testing` skill for general testing practices\n- → See `samber\u002Fcc-skills@promql-cli` skill for querying Prometheus runtime metrics in production to validate benchmark findings\n",{"name":5,"paths":44,"license":15,"metadata":46,"description":7,"allowed-tools":60,"compatibility":61,"user-invocable":62},[45],"**\u002F*.go",{"author":47,"version":48,"openclaw":49},"samber","1.3.0",{"emoji":50,"install":51,"homepage":57,"requires":58},"?",[52],{"bins":53,"kind":55,"package":56},[54],"benchstat","go","golang.org\u002Fx\u002Fperf\u002Fcmd\u002Fbenchstat@latest","https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":59},[55,54],"Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(benchstat:*) Bash(benchdiff:*) Bash(cob:*) Bash(gobenchdata:*) Bash(curl:*) mcp__context7__resolve-library-id mcp__context7__query-docs WebSearch AskUserQuestion EnterWorktree ExitWorktree","Designed for Claude Code, Codex or similar harness, and for projects using Golang.",true,"main","c349be0704bffe54a7191d1412faf564b08983ca","skills\u002Fsamber-golang\u002Fgolang-benchmark",0,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills","https:\u002F\u002Fgithub.com\u002Frockcookies","2026-11-12 14:42:52",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":62},[72,75,78],{"tool":73,"command":74},"npx","npx skills add rockcookies\u002Fskills --skill golang-benchmark",{"tool":76,"command":77},"bunx","bunx skills add rockcookies\u002Fskills --skill golang-benchmark",{"tool":79,"command":80},"pnpm","pnpm dlx skills add rockcookies\u002Fskills --skill golang-benchmark","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002FSKILL.md",[83,89,93,97,101,105,109,113,117],{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"evals\u002Fevals.json","REFERENCE","参考文档",93382,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002Fevals\u002Fevals.json",{"path":90,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fbenchstat.md",14540,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002Freferences\u002Fbenchstat.md",{"path":94,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fci-regression.md",10659,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002Freferences\u002Fci-regression.md",{"path":98,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fcompiler-analysis.md",10972,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002Freferences\u002Fcompiler-analysis.md",{"path":102,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Finvestigation-session.md",7241,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002Freferences\u002Finvestigation-session.md",{"path":106,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Fpprof.md",33831,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002Freferences\u002Fpprof.md",{"path":110,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":111,"sourceHtmlUrl":112},"references\u002Fprometheus-go-metrics.md",11623,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002Freferences\u002Fprometheus-go-metrics.md",{"path":114,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":115,"sourceHtmlUrl":116},"references\u002Ftools.md",3983,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002Freferences\u002Ftools.md",{"path":118,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":119,"sourceHtmlUrl":120},"references\u002Ftrace.md",18448,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-benchmark\u002Freferences\u002Ftrace.md",[122,154,178,201,227,242],{"skillNo":123,"name":124,"nameZh":125,"description":126,"descriptionZh":127,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":128,"sourceHtmlUrl":129,"categories":130,"keywords":141,"publishedAt":153},"01M6CFPKHRH0GD3W2GTGWE9WGP","kami","Kami 专业文档排版","Typeset professional documents with Kami templates: resumes, one-pagers, white papers, letters, portfolios, and slide decks. Use when asked to 做 PDF \u002F 排版 \u002F 简历 \u002F 一页纸 \u002F PPT \u002F slides, or to create a Kami landing page. Not for auditing or restyling an existing product site.","使用 Kami 模板排版专业文档：简历、一页纸、白皮书、信件、作品集和幻灯片。当用户要求做 PDF \u002F 排版 \u002F 简历 \u002F 一页纸 \u002F PPT \u002F slides，或创建 Kami 落地页时使用。不适用于审查或重新设计现有产品网站。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftw93-kami\u002Fkami\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftw93-kami\u002Fkami\u002FSKILL.md",[131,136],{"categoryNo":132,"categoryName":133,"taxonomyType":134,"taxonomyTypeDesc":135},"01M8BQ6TK1MPB82068236GSXDE","文档处理","SCENARIO","使用场景",{"categoryNo":137,"categoryName":138,"taxonomyType":139,"taxonomyTypeDesc":140},"01M8C55A3R2M9C8CAKG3W16HTA","内容创作者","PROFESSION","适用职业",[124,142,143,144,145,146,147,148,149,150,151,152],"create","PDF","pptx","slides","product","page","landing","templates","site","use","documents","2026-11-12 13:55:43",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":39},"01M6WMNKD3Y4H9FGM8Q901F507","hierarchical-agents-md","层级 AGENTS.md \u002F README.md：init、update、audit、reorganize、trim。 初始化 Agent 指令、代码改动后同步文档、检查文档漂移、重组仓库文档层级、精简规则与 Skills。 Not for 写业务代码或生成文档站点。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fhierarchical-agents-md\u002FSKILL.md",[],[161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177],"hierarchical agents md","agents md","packages","change","maintenance","初始化","audit","for","README","update","python","init","git","true","party","third-party","文档",{"skillNo":179,"name":180,"nameZh":181,"description":182,"descriptionZh":183,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":192,"publishedAt":39},"01M6CFS6BRTQPFZCDHQP97HYXR","vueuse-functions","VueUse 组合式函数应用","Apply VueUse composables where appropriate to build concise, maintainable Vue.js \u002F Nuxt features.","在合适的地方应用 VueUse 组合式函数（composables），以构建简洁、可维护的 Vue.js \u002F Nuxt 功能。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvueuse\u002Fvueuse-functions\u002FSKILL.md",[186,189],{"categoryNo":187,"categoryName":188,"taxonomyType":139,"taxonomyTypeDesc":140},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":190,"categoryName":191,"taxonomyType":134,"taxonomyTypeDesc":135},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[193,194,195,196,197,198,199,200],"vueuse functions","functions","nuxt","https","vue","build","github","js",{"skillNo":202,"name":203,"nameZh":204,"description":205,"descriptionZh":206,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":207,"categories":208,"keywords":215,"publishedAt":39},"01M6CFS34MDQXZPAWQFE5D7VGT","vue-testing-best-practices","Vue.js 测试最佳实践","Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.","用于 Vue.js 测试。涵盖 Vitest、Vue Test Utils、组件测试、模拟（mocking）、测试模式，以及用于 E2E 测试的 Playwright。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs-ai\u002Fvue-testing-best-practices\u002FSKILL.md",[209,212],{"categoryNo":210,"categoryName":211,"taxonomyType":139,"taxonomyTypeDesc":140},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":213,"categoryName":214,"taxonomyType":134,"taxonomyTypeDesc":135},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[216,217,218,197,219,200,220,221,151,222,223,224,199,225,226],"vue testing best practices","testing","testing best practices","best practices","e2e testing","playwright","test","testing patterns","component","vitest","e2e",{"skillNo":228,"name":229,"nameZh":230,"description":231,"descriptionZh":232,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":233,"categories":234,"keywords":237,"publishedAt":39},"01M6CFS0N19MSJNTVM9AEQ7Z73","vue-router-best-practices","Vue Router 路由最佳实践","Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.","Vue Router 4 模式、导航守卫、路由参数以及路由与组件生命周期的交互。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs-ai\u002Fvue-router-best-practices\u002FSKILL.md",[235,236],{"categoryNo":187,"categoryName":188,"taxonomyType":139,"taxonomyTypeDesc":140},{"categoryNo":190,"categoryName":191,"taxonomyType":134,"taxonomyTypeDesc":135},[219,238,197,239,224,199,240,241],"vue router best practices","router","navigation","lifecycle",{"skillNo":243,"name":244,"nameZh":245,"description":246,"descriptionZh":247,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":248,"categories":249,"keywords":252,"publishedAt":39},"01M6CFRYN31RFQFTE41Z6DCGKE","vue-pinia-best-practices","Pinia 状态管理最佳实践","Pinia stores, state management patterns, store setup, and reactivity with stores.","Pinia store、状态管理模式、store 配置以及 store 的响应式处理。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs-ai\u002Fvue-pinia-best-practices\u002FSKILL.md",[250,251],{"categoryNo":187,"categoryName":188,"taxonomyType":139,"taxonomyTypeDesc":140},{"categoryNo":190,"categoryName":191,"taxonomyType":134,"taxonomyTypeDesc":135},[253,219,197,254,199,255,256,257,258],"vue pinia best practices","pinia","state","state management","management","setup"]