XPerf
Guides

XPerf overview

XPerf is the umbrella for language performance kits. Each kit is independently usable: a measured guide, examples, fixtures, and a heuristic linter written in (or for) that language. The root holds shared method docs and the cross-kit smell index — not a Zig-only tree with other languages bolted on.

Architecture

Shared loop (see playbook.md): inventory → evidence → corpus lint → reverse-opt → dogfood → docs. Severity escalates to default error only with paired fixtures and measured before/after JSONL.

Cross-lang index: smell-catalog.md maps the same smell across kits. Rule IDs are per-kit slugs; jsperf and jvmperf both use the jp- prefix with disjoint slug sets (jsperf jp-alloc-hot ≠ any jvmperf rule). A YES on one runtime does not transfer — re-bench when porting advice.

Per-kit status

All 19 kits passed the AGENT.md corpus-ready (G3) gate as of 2026-10-22 (Asia/Shanghai). Heuristics ≠ guaranteed speedups.

KitLint entryGuideNotes
zperfzperf-lint (Zig AST)EN · corpus-readyG3/r4; default-on TP set; OK-idiom mass off; allocPrint-in-loop hint
cperfcperf-lint (C11)EN v0 · corpus-readycp-alloc / cp-realloc error; strlen, hot-call, wide-bool-flag, alloca-in-loop, and large by-value struct hints; cp-printf / cp-strcat off
jsperfjsperf-lint (pure JS)EN v0 + V8/startup · corpus-readyjp-delete-array-hole error; string+/map-filter/regex/JSON/DOM/readFile/clock hint; alloc/delete-shape off
jvmperfjvmperf-lint (Java)EN · corpus-readyG3/G4 defaults; JMH/JOL; STATIC-VS-HOTSPOT
goperfgoperf-lint (Go)EN v0 · corpus-readyappend-nil / defer / regexp / JSON / reflect / open / clock hint; make/string+/fmt off
pyperfpyperf-lint (pure Python)EN v0 · corpus-readylist-plus plus JSON/deepcopy/open hint; str+/print off; re.compile and datetime-format removed
swiftperfswiftperf-lint (Swift PM)EN v0 · corpus-readyreserve / map-joined hint, plus date-formatter / JSON / regex / file-read / clock / value-for-key hints; text-lint parity without SDK
arktsperfarktsperf-lint (pure Node)EN v0 · corpus-readyat-includes / at-json hint; alloc/delete/console off
cppperfcppperf-lint (C++17)EN v0 · corpus-readyregex, endl, clock, ifstream, const-by-value, and vector-bool hints (string append and string-stream removed); ≠ cperf
csharpperfcsharpperf-lint (dotnet)EN v0 · corpus-readyregex / LINQ materialize / format / JSON / file-read / clock / field-by-name hint; list/string+/console off; needs dotnet
phpperfphpperf-lint (pure PHP)EN v0 · corpus-readyph-array-merge-rebind error (G4); ph-string-dot-hot off; ph-echo-hot hint
rubyperfrubyperf-lint (pure Ruby)EN v0 · corpus-readyhash-merge / regexp / JSON / file-read hint; string+/array+/puts off
rustperfrustperf-lint (Rust)EN v0 · corpus-readyformat-rebind error; string+/println/vec/collect/regex/file-open/clock hint; alloc off
kotlinperfkotlinperf-lint (Kotlin)EN v0 · corpus-readykt-* all off by default; empty-add rule removed; ≠ jvmperf JMH
objcperfobjcperf-lint (C scan .m)EN v0 · corpus-readyappend / nslog off; date-formatter, JSON, regex, file-read, clock, and value-for-key hints; array-add rules removed; ≠ swiftperf
dartperfdartperf-lint (Dart)EN v0 · corpus-readydt-growable-add-empty hint; list/string+/print off
luaperfluaperf-lint (pure Lua)EN v0 · corpus-readylu-string-concat-hot error (G4); lu-table-insert-hot off; lu-print-hot hint
beamperfbeamperf-lint (Elixir)EN v0 · corpus-readybe-list-concat / be-map-merge / be-enum-chain hint; string-<> removed; be-io-puts off
nimperfnimperf-lint (Nim)EN v0 · corpus-readynm-seq-no-capacity hint; seq-add/string/echo off; needs nim

What this is not

  • Not a substitute for perf, Tracy, JMH, or browser profilers.
  • Not type-aware analysis (except where a language toolchain already embeds it).
  • Not a place for large third-party source trees (those stay outside the repo).

Evidence rule

Guide claims that assert speedups should name a local JSONL bench, an upstream issue/PR, or both. Heuristic lint findings and corpus residual counts are review prompts / dogfood, not speedups. Coverage and honest gaps: rule-regression.md.

Docs