XPerf
LanguagesGo

goperf evidence policy

Gate

A rule may be treated as error only if both exist under packages/goperf/evidence/:

  1. <RULE>.md — claim, how measured, go version / flags, limits
  2. <RULE>.jsonl — ≥1 before/after line with rule, case, median_ns (or median_ms), ops, ratio, ts

Otherwise the rule stays hint (or off after G3 OK-idiom demotion).

Current map

As of 2026-10-22.

RuleSeverityEvidenceSmell
gp-make-hotoffyes ~265×make/new in loop (G3 OK-idiom)
gp-string-plus-hotoffyes ~2919×string += in loop (G3 OK-idiom)
gp-fmt-hotoffyes ~2.8×fmt.*printf in loop (G3 OK-idiom)
gp-append-nil-slicehintyes ~12.2×empty slice + append in size-hinted loop
gp-defer-hothintyes ~33×defer in loop
gp-regexp-compile-hothintmeasured (gp-regexp-compile-hot.md + gp-regexp-compile-hot.jsonl); stay hintregexp.Compile in loop; not corpus-triaged
gp-json-marshal-hothintmeasured (gp-json-marshal-hot.md + gp-json-marshal-hot.jsonl); stay hintjson.Marshal / Unmarshal in loop; not corpus-triaged
gp-reflect-hothintmeasured (gp-reflect-hot.md + gp-reflect-hot.jsonl); stay hintFieldByName / MethodByName / reflect.New in loop; TypeOf is not matched; not corpus-triaged
gp-os-open-hothintmeasured (gp-os-open-hot.md + gp-os-open-hot.jsonl); stay hintos.Open in a loop; same path only; not corpus-triaged
gp-time-now-hothintmeasured (gp-time-now-hot.md + gp-time-now-hot.jsonl); stay hinttime.Now in a loop; not time.Parse; not corpus-triaged

Measured .md + .jsonl exist for all five rules, but none auto-escalates: gp-append-nil-slice/gp-defer-hot stay hint and the three demoted rules stay off (G3 OK-idiom history). Re-enable demoted rules with --severity <rule>=hint (for example --severity gp-make-hot=hint).

On this page