Microsoft has released .NET 9, delivering substantial performance improvements and new APIs that make everyday C# code more expressive and efficient.
The .NET 9 JIT compiler includes loop optimizations, improved inlining for generic methods, and better AVX-512 vectorization support. Benchmarks show 5–15% throughput improvements on CPU-bound workloads compared to .NET 8.
// CountBy
var wordCounts = words.CountBy(w => w.ToLower());
// AggregateBy
var totalSales = orders.AggregateBy(
o => o.Region,
seed: 0m,
(total, order) => total + order.Amount
);
The new Task.WhenEach yields results as each task completes, rather than waiting for all:
await foreach (var result in Task.WhenEach(tasks))
{
Console.WriteLine($"Completed: {result.Result}");
}
All Comments