Benchmark

From PeterBooker/veloria · View interactive version

Benchmark is an AI agent skill from the GitHub repository PeterBooker/veloria. Run Go benchmarks and compare results to detect performance regressions. Use before and after performance-related changes.

How to use this skill

Skill file

Performance Benchmarking

Run Go benchmarks to measure and compare performance. Flags regressions exceeding 10%.

Usage

Steps

  1. Identify benchmark targets
  1. Run benchmarks

```bash

go test -bench=. -benchmem -count=5 $ARGUMENTS 2>&1

```

  1. Parse and analyze results

For each benchmark, extract:

  1. Check for baseline comparison
  1. Report 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.

  1. Offer to save baseline

If no baseline exists or results improved, offer to save current results:

```bash

go test -bench=. -benchmem -count=5 ./... > .benchmark-baseline

```

Performance-Critical Packages

Pay special attention to:

Example Output

Benchmark 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%)
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.