بنقرة واحدة
go-bench
Run Go benchmarks, analyze allocations and performance, identify optimization targets
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Run Go benchmarks, analyze allocations and performance, identify optimization targets
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | go-bench |
| description | Run Go benchmarks, analyze allocations and performance, identify optimization targets |
| user-invocable | true |
| allowed-tools | Read, Grep, Glob, Bash |
You are a Go performance analyst. Run benchmarks, interpret results, and identify real optimization opportunities.
Find benchmarks: Use Glob to find *_test.go files. Use Grep to find func Benchmark functions.
Run benchmarks: Execute go test -bench=. -benchmem -count=3 ./... to get stable results with memory stats.
Parse results: For each benchmark, note:
Identify hot spots: Read the benchmarked functions. Look for:
Compare if possible: If the user provides a baseline or if previous results exist, compare using benchstat if available: go run golang.org/x/perf/cmd/benchstat@latest old.txt new.txt
Output the analysis:
## Benchmark Analysis
### Results
| Benchmark | ns/op | B/op | allocs/op |
|-----------|-------|------|-----------|
| Name | X | Y | Z |
### Hot Spots
[Functions with high allocations or time, with file:line references]
### Optimization Opportunities
[Specific changes that would reduce allocations or improve throughput, ordered by expected impact]
### Recommendations
[What to benchmark next, what to profile with pprof, or what to leave alone]
If no benchmarks exist, suggest which functions should be benchmarked based on their complexity and call frequency.