Performance features in C#
summary
Covers concrete language changes and measurable wins: introduces Span<T> as a zero-allocation unified memory view, adds ref returns/ref locals to avoid copies (benchmarks show ~10x speed on returns), exposes function pointers for cheaper native interop, and adds skip-locals-init to skip needless stack zeroing. Shows a source generator that compiles regex at build time (avoids runtime IL generation), and new interpolated-string handlers that make formatting almost 2x faster with 80% fewer allocations.
AI-written summary · about
chapters (17)
- 0:00Intro
- 0:54Who am I
- 1:14Performance in C
- 6:25C Sharp 7
- 7:20Apis
- 11:28Ref and ReadOnly
- 13:28Ref
- 20:16Benchmark
- 22:05Skip locals in it
- 24:11Function pointers
- 24:38Native interop
- 27:15Source generators
- 33:17String interpolation
- 37:27Stack allocating
- 42:20Ref fields
- 43:59Other features
- 45:37Questions
related talks
56mState of the .NET Performance
59mHigh-performance code design patterns in C#
01h 04mTurbocharged: Writing High-Performance C# and .NET Code
59mLet’s catch up with C#! Exciting new features in C# 9, 10, 11, 12 and 13!
59mWhat's new in C#? Exciting new features in C# 9, 10 and 11!
59mLet’s catch up with C#! Exciting new features in C# 9, 10, 11, 12 and 13!
47mUnlocking Performance Improvements in .NET
01h 00mMetaprogramming for the masses
