This post details a technique for reducing allocation when calling `foreach` on an `IEnumerable` in .NET, optimizing code for Datadog. It highlights a subtle difference between `IEnumerable` and `List` implementations, and demonstrates a benchmark to confirm the performance impact.