Skip to content
Skills Library
Programming · Analysis

performance

/performance

Use when optimizing or reviewing latency, throughput, CPU, memory, allocations, queries, data layout, update frequency or concurrency in a backend service in any language pack, based on measurement; the benchmark and profiler workflow (Go: benchstat and pprof).

Repository
ai-loops ↗
Licence
MIT
Last repository change
13.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when optimizing or reviewing latency, throughput, CPU, memory, allocations, queries, data layout, update frequency or concurrency in a backend service in any language pack, based on measurement; the benchmark and profiler workflow (Go: benchstat and pprof).

Original author description

Use when optimizing or reviewing latency, throughput, CPU, memory, allocations, queries, data layout, update frequency or concurrency in a backend service in any language pack, based on measurement; the benchmark and profiler workflow (Go: benchstat and pprof).

How it works

  1. Load
  2. Escalation order
  3. Scale mindset
  4. Measurement
  5. Data rules
  6. Database and I/O
  7. Concurrency
  8. Regression rule
Original SKILL.md headings · 69 lines, 438 words
SKILL.md preview
---
name: performance
description: "Use when optimizing or reviewing latency, throughput, CPU, memory, allocations, queries, data layout, update frequency or concurrency in a backend service in any language pack, based on measurement; the benchmark and profiler workflow (Go: benchstat and pprof)."
---

# Performance and scale

## Load

- Your language: `loops:lang-<id>` and its `idioms.md`, `testing.md` (benchmark harness) and `concurrency.md`. Go: `specs/languages/go/RULES.md §22` allocation, `§31` benchmarks, `§32` complexity, `§33` data layout, `§53` escalation.
- `specs/ARCHITECTURE.md §12` ownership (what may be parallel).

## Escalation order

```text
1. eliminate O(N^2) and global scans (N+1 queries, full-table scans)
2. reduce update or polling frequency
3. add indexes
4. add dirty invalidation
5. skip inactive state
6. batch operations
7. reduce allocations
8. improve data layout and locality
9. cache (with explicit invalidation)
10. parallelise pure work
11. micro-optimise only with evidence
```

Do not jump to concurrency, caching or unsafe code first.

## Scale mindset

Every hot path answers:

```text
N (items, rows, requests per second):
frequency:
complexity:
index / query plan:
invalidation trigger:
allocations:
parallelisable pure work:
```

## Measurement

Before and after, record: time per op, bytes and allocations per op where the runtime reports them, input size, concurrency, and for services p50/p99 latency and throughput. Run the pack's benchmark harness several times on each side (`skills/lang-<id>/testing.md`) and compare statistically, not one run against one run. Profile CPU, memory and contention with the language's profiler before changing code. Go example:

```bash
go test -run=^$ -bench=BenchmarkX -benchmem -count=10 ./pkg > old.txt
# change
go test -run=^$ -bench=BenchmarkX -benchmem -count=10 ./pkg > new.txt
benchstat old.txt new.txt
```

Go also has `pprof` (CPU, heap, allocs, mutex, block), execution traces and `-gcflags='-m=2'` for escapes (confirm with a benchmark). Never claim an improvement without the before/after numbers.

## Data rules

Prefer dense arrays (Go slices), stable compact IDs, bit flags, caller-provided scratch buffers where proven useful, and queries bounded by an index. Avoid pointer-heavy graphs, repeated whole-table scans, temporary maps per request, string keys in hot loops, a thread, task or goroutine per item, and allocating iterator abstractions without evidence.

## Database and I/O

Check query plans (`EXPLAIN`); batch round trips; paginate with keyset where deep offsets appear; bound result sizes; set timeouts; reuse connections and clients.

## Concurrency

Parallelise only pure or snapshot-based work. A parallel stage reads an immutable view, runs on a bounded pool, writes only to per-task results, derives randomness per task, and is committed in deterministic order (`skills/consistency`). Keep it only if the A/B shows a gain that matters, and ship an equality test at pool sizes 1, 2 and 8. Check it under the pack's race policy (WORKFLOW §6).

## Regression rule

A change that meaningfully worsens a core benchmark must be fixed or carry a documented trade-off in the claims report. Unsafe code (Go `unsafe`, Rust `unsafe`, native extensions) needs an ADR, benchmark proof, tests and a portability analysis.

Versions

RepositoryScoreLicence
This page · arxdsilva/ai-loops100MIT
ericrisco/rsc-harness100MIT
yonatangross/orchestkit100MIT
yonatangross/orchestkit100MIT
davila7/claude-code-templates100MIT
motormetrics/motormetrics100MIT
motormetrics/motormetrics100MIT
event4u-app/agent-config100MIT
krzysztofsurdy/code-virtuoso100MIT

Database snapshot: 13.11.2026 · package version 5fdc50aa8584 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100go-performance-review
    Detect performance anti-patterns and apply optimization techniques in Go. Covers allocations, benchmarks and benchstat, pprof and traces, GC and GOMEMLIMIT tuning, PGO, and HTTP client reuse. Use when checking performance, finding slow code, reducing allocations, profiling, or…
  • 100golang-benchmark
    Golang benchmarking, profiling, and performance measurement. Use when writing, running, or comparing Go benchmarks, profiling hot paths with pprof, interpreting CPU/memory/trace profiles, analyzing results with benchstat, setting up CI benchmark regression detection, or…
  • 100go-pprof-cpu-memory-goroutine-profiling
    Use this skill when analyzing CPU utilization, memory allocations, and goroutine leaks in Go applications using runtime/pprof.
  • 100review-performance
    Use when the user explicitly asks for a performance review, benchmark review, profiling review, perf audit, pprof analysis, allocation review, latency regression check, hot-path review, throughput review, "is this fast enough", or "review perf". This skill is opt-in only — never…
  • 100performance-audit
    Profiling, benchmarking, Web Vitals audit, N+1 detection, and performance optimization. Use when: performance, profiling, Web Vitals, N+1, slow, optimize, benchmark, latency, throughput.
  • 90performant-go
    Strategies for high-performance Go systems (Goroutines, Channels, Pprof, Memory Alignment). Use when: go, golang, performance, goroutines, channels, pprof, gc, scalability.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.