Developers commonly mix async with LINQ:
var results = items.Select(async x => await Process(x)); await Task.WhenAll(results);
Looks correct, right?
Nope. This triggers thousands of async state machines, killing perf.
await Parallel.ForEachAsync(items, async (item, ct) =>
{
await Process(item);
});
💡 Why It Saves You
-
uses shared workers
-
avoids micro-task explosion
-
predictable throughput
