XPerf
语言C#

csharpperf-lint

这篇还没有中文,下面是英文原文。

C# heuristic checker (requires dotnet SDK to build). Slugs are listed in ../docs/rule-ids.md. cs-json-hot is not part of the 2026-10-22 corpus-ready verdict.

RuleDefaultMessage
cs-list-add-no-capacityoffList.Add in loop without Capacity / pre-size
cs-string-plus-hotoffstring += in loop; prefer StringBuilder
cs-console-hotoffConsole.Write* in loop; gate or buffer
cs-regex-hothintRegex in a loop; compile outside only when the pattern stays the same
cs-linq-materialize-hothintToList / ToArray / ToDictionary in loop; materialize once
cs-format-hothintstring.Format in loop; format outside or use a builder
cs-json-hothintJSON encode or decode in a loop; hoist only when this value stays the same

Smoke skips gracefully when dotnet is absent. Corpus-ready after G3 redesign — see ../docs/corpus.md.