Turbocharged: Writing High-Performance C# and .NET Code
summary
Covers concrete techniques and measured wins: uses Span<T> slicing and System.Memory to avoid copies, ArrayPool rent/return for temporary buffers, System.IO.Pipelines with ReadOnlySequence for streaming, and low‑level System.Text.Json UTF8 reader for early exit. Benchmarks use BenchmarkDotNet and profilers. Example results: object key builder becomes ~26% faster and cuts allocations 74%, a pipeline rewrite runs ~81% faster and reduces allocations 97%, and a JSON fast path returns in ~200 ns with zero allocations; a real service saves ~10 GB/day on 18 million messages.
AI-written summary · about
chapters (15)
- 0:00Welcome and introduction
- 1:10Performance goals and trade-offs
- 6:27Optimization cycle and measurement
- 9:35Tools for measuring performance
- 13:25Benchmarking with BenchmarkDotNet
- 19:01Introducing Span<T>
- 24:58Optimizing with Span<T>
- 35:54Memory<T> role
- 36:15Optimizing string processing
- 43:14ArrayPool for allocations
- 47:07System.IO.Pipelines
- 51:56File parsing with pipelines
- 55:03High-performance JSON parsing
- 59:39JSON parsing demo
- 1:01:01Turning optimizations into value
related talks
01h 14mTurbocharged: Writing High-performance C# and .NET code
01h 01mTurbocharged: Writing High-Performance C# and .NET Code
59mHigh-performance code design patterns in C#
47mUnlocking Performance Improvements in .NET
37mRock Your Code Code and App Performance for Microsoft .Net
56mState of the .NET Performance
52mPerformance features in C#
59mPerformance tricks I learned from contributing to open source .NET packages
