.NET 9 Released: Performance Gains and New LINQ Methods

.NET 9 Released: Performance Gains and New LINQ Methods

.NET 9 Released: Performance Gains and New LINQ Methods

Microsoft has released .NET 9, delivering substantial performance improvements and new APIs that make everyday C# code more expressive and efficient.

Performance Improvements

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.

New LINQ Methods

// CountBy
var wordCounts = words.CountBy(w => w.ToLower());

// AggregateBy
var totalSales = orders.AggregateBy(
    o => o.Region,
    seed: 0m,
    (total, order) => total + order.Amount
);

Task.WhenEach

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