State of the .NET Performance
summary
C# 7.2 and .NET Core add concrete tools: ref returns & locals eliminate copying and made a benchmark 4.5× faster for large structs; using value types instead of references on a 100M-element loop costs ~3× less time and cache misses. Span slices without copy so substring is ~3× slower and allocates, while ArrayPool rents ~32ns (avoid >85,000 bytes to skip LOH and full GCs); ValueTask lets hot-path async avoid allocations if IsCompleted is checked and synchronous fast-path is used.
AI-written summary · about
chapters (13)
- 0:00Start
- 1:32Value Tuple vs Tuple
- 1:55Reference Types: Memory Layout
- 2:36Value Types: Memory Layout
- 5:30Value Types: No GC
- 6:27Value Types: the disadvantages?!
- 22:40Struct Tearing
- 26:09Stack Only: No Heap Limitations
- 36:04Buffer Allocated event
- 40:14Async Task Method Builder
- 40:58Value Task vs Task: Overhead Only
- 52:42C# 7.2: blittable types??
- 54:11Summary Start using Value Types today! Use references to avoid copying of Value Types
related talks
52mPerformance features in C#
47mUnlocking Performance Improvements in .NET
59mHigh-performance code design patterns in C#
01h 04mTurbocharged: Writing High-Performance C# and .NET Code
01h 14mTurbocharged: Writing High-performance C# and .NET code
43mPragmatic Performance: When to care about perf, and what to do about it.
37mRock Your Code Code and App Performance for Microsoft .Net
59mWriting (in)efficient C#
