一键导入
benchmark
Run Go benchmarks and compare results to detect performance regressions. Use before and after performance-related changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run Go benchmarks and compare results to detect performance regressions. Use before and after performance-related changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run pre-push quality checks (vet + lint + tests with race detector). Use before pushing code.
Run tests with coverage analysis and identify untested code paths. Use to find gaps before releases.
Check and tidy Go module dependencies. Use after adding/removing imports or before releases.
Run go generate to build templ templates and frontend assets. Use after changing templates or CSS/JS.
Run integration tests that require Docker (Postgres, MinIO via testcontainers). Use to validate database and storage behavior.
Run golangci-lint and static analysis on Go code. Use before pushing or to check code quality.
| name | benchmark |
| description | Run Go benchmarks and compare results to detect performance regressions. Use before and after performance-related changes. |
| disable-model-invocation | true |
| argument-hint | package-path |
Run Go benchmarks to measure and compare performance. Flags regressions exceeding 10%.
/benchmark - Run benchmarks on all packages/benchmark ./internal/index/... - Run benchmarks on specific package/benchmark -compare ./... - Compare against saved baselineIdentify benchmark targets
$ARGUMENTS specifies a package, use that*_test.go files containing Benchmark functionsinternal/index/, internal/repo/, internal/api/Run benchmarks
go test -bench=. -benchmem -count=5 $ARGUMENTS 2>&1
-count=5 for statistical reliability-benchmem to track allocationsParse and analyze results For each benchmark, extract:
ns/op - Nanoseconds per operationB/op - Bytes allocated per operationallocs/op - Allocations per operationCheck for baseline comparison
.benchmark-baseline file in project root-compare flag used and baseline exists, compare resultsReport findings Format results as a table:
| Benchmark | ns/op | B/op | allocs/op | Change |
|-----------|-------|------|-----------|--------|
Flag any metric that regressed more than 10% with a warning.
Offer to save baseline If no baseline exists or results improved, offer to save current results:
go test -bench=. -benchmem -count=5 ./... > .benchmark-baseline
Pay special attention to:
internal/index/ - Trigram search (hot path)internal/repo/ - Repository access patternsinternal/api/search/ - Search request handlinginternal/storage/ - S3 result compressionBenchmark Results for ./internal/index/...
| Benchmark | ns/op | B/op | allocs/op |
|---------------------|----------|-------|-----------|
| BenchmarkSearch-8 | 1234567 | 4096 | 12 |
| BenchmarkOpen-8 | 567890 | 8192 | 24 |
No regressions detected (threshold: 10%)