Performance Hotpath Risk
Detects Thread.Sleep, LINQ queries inside loops, and unbounded collection growth inside loops that degrade throughput in hot paths.
Why this rule exists
Thread.Sleep blocks a thread-pool thread. LINQ inside a loop turns O(n) into O(n^2). Unbounded list growth turns a 100-item test into an OOM at 100k items. None of these show up in unit tests.
Code example
+ foreach (var id in ids)
+ {
+ var match = users.FirstOrDefault(u => u.Id == id);
+ Thread.Sleep(10);
+ }+ var byId = users.ToDictionary(u => u.Id);
+ foreach (var id in ids)
+ {
+ var match = byId.GetValueOrDefault(id);
+ await Task.Delay(10, ct);
+ }Configuration
Disable or adjust the severity of this rule in .gauntletci.json:
{
"rules": {
"GCI0044": { "enabled": true, "severity": "Info" }
}
}See Configuration for the full schema.
Related rules
Concurrency and State Risk
Detects async void methods, blocking async calls (.Result, .Wait()), static mutable state, and patterns that introduce deadlock risk.
Resource Lifecycle
Detects disposable resources allocated without a using statement or try/finally disposal, leading to connection and handle leaks.
Implemented in src/GauntletCI.Core/Rules/Implementations/GCI0044_*.cs.
Eric Cogen -- Founder, GauntletCI
Twenty years in .NET production. Most of those years, the bugs that hurt me were not the ones tests caught. They were the assumptions I did not know I was making: a removed guard clause, a renamed method that still did the old thing, a catch {} that turned a page into a silent dashboard lie. GauntletCI is the checklist I wish I had run before every commit. It runs the rules I learned the hard way, so you do not have to.
