State of the .NET Performance
summary
Overview of concrete tools and measured wins: uses BenchmarkDotNet and System.Buffers' ArrayPool; ref returns and ref locals cut repeated struct copies and speed a tight loop by ~4x; ValueTask avoids allocations on hot synchronous paths; renting buffers from ArrayPool beats new for large buffers (about 8–9x) and prevents LOH-triggered full GCs; Span slicing makes substring-like operations zero-allocation and shows ~4.5x slower for String.Substring(10) and ~47x for 1,000 versus slicing; stackalloc and managed references remove pins and unsafe in many hot paths.
AI-written summary · about
chapters (14)
- 0:00Introduction and speaker background
- 1:12Garbage collection and .NET Core basics
- 3:01Value types and performance benefits
- 5:32Read-only structs and defensive copying
- 6:14Managed references vs unsafe code
- 11:18ValueTask for async optimization
- 16:04Garbage collection generations and large objects
- 17:54ArrayPool for memory pooling
- 23:17Stackalloc and memory allocation methods
- 26:12Span for zero-allocation slicing
- 33:20Contributing to .NET Core
- 39:16Intermediate Language and performance
- 41:08Summary and performance tips
- 43:20Q&A session
