Performance Improvements in .NET 6
summary
Hundreds of targeted fixes make .NET 6 noticeably faster: cancellation registration costs drop from ~150 ns/400 B in older releases to ~half the time and half the allocation by .NET 6; a pathological thread‑pool case falls from ~35 s to ~1 s by being aggressive about injecting threads; Random.NextBytes goes from ~70 µs to ~1 µs (≈70×); GUID parse hits ~30 ns; string interpolation becomes zero‑alloc with ~40 ns vs 160 ns previously; file I/O is truly async and doubles throughput while eliminating allocations; array pool cliff removed; overall thread‑pool blocking fixed and many vectorized hotspots are accelerated.
AI-written summary · about
chapters (15)
- 0:00Introduction to .NET 6 performance
- 7:14Revisiting past assumptions in threading
- 17:50Caching all the things in async
- 22:52Optimizing system libraries
- 33:06Vectorizing hot paths
- 38:02Special casing common inputs
- 41:38Removing array pool cliff
- 44:26Making async IO actually async
- 47:19Stopping unnecessary work in networking
- 49:07Making new faster
- 50:14Faster reflection with defensive copies
- 51:59Optimizing LINQ operations
- 54:27Stopping being lazy in crypto
- 56:36Building at compile time
- 58:44Summary and next steps
related talks
01h 04mWhat is new in .NET 6 and the future of .NET
47mUnlocking Performance Improvements in .NET
56mState of the .NET Performance
37mRock Your Code Code and App Performance for Microsoft .Net
01h 06m.NET Systems Programming Learned the Hard Way
40mReal-world examples on optimizing .NET performance
46mDeep dive into .NET performance and native AOT
46mWhat Is New in .Net 6 and the Future of .Net
