XPerf
LanguagesGo

goperf

Go performance notes, small examples, and goperf-lint written in Go.

Part of XPerf. Shared docs: docs/README.md. Corpus-ready (G3 2026-10-22). Defaults: gp-make-hot–gp-fmt-hot off, gp-append-nil-slice/gp-defer-hot hint. No invented JSONL.

Contents

Focus

Size-hinted empty-slice growth (make([]T, 0, n)), defer pile-up in loops. Older make/string/fmt loop heuristics remain opt-in after G3 OK-idiom demotion.

Run lint

cd packages/goperf/goperf-lint
go build -o goperf-lint ./cmd/goperf-lint
./goperf-lint path/to/sources
./goperf-lint path/to/sources --severity gp-append-nil-slice=error
bash ../scripts/smoke-lint.sh
bash ../scripts/self-lint.sh

Exit 1 only when an error-severity finding exists (hints print but exit 0 unless --strict-hints).

Layout

docs/guide-src/   chapter sources
docs/             assembled guide + corpus.md + evidence-policy.md
evidence/         per-rule claims + measured JSONL
examples/         tiny Go demos
goperf-lint/      Go checker + fixtures
scripts/          smoke-lint.sh, self-lint.sh