Pragmatic Performance: When to care about perf, and what to do about it
summary
Argues performance decisions need concrete context: where code runs, worst cases and data shape, not slogans. Recommends measuring with BenchmarkDotNet (warmup, single-exe runs, GC control, release build, return values) instead of ad-hoc Stopwatch loops. Shows measured surprises: string concatenation vs StringBuilder vs string.Join in the 10–10,000-item range (nanoseconds and memory swing), concrete Dictionary twice as fast as IDictionary, and the .NET hybrid dictionary switching at nine items. Focus on hot paths, goals (time vs RAM) and trends, not gut feeling.
AI-written summary · about
chapters (18)
- 0:00Intro
- 6:05Premature optimization
- 8:12Context
- 18:44Running benchmarks
- 27:12Benchmark features
- 28:45String concatenation
- 29:26String concatenation results
- 31:35What are you trying to achieve
- 32:46Dictionary vs ID
- 33:21Dictionary vs Interface
- 34:16Interface vs Concrete
- 34:58Loops vs Link
- 36:32Benchmarking Link
- 37:27String case conversions
- 38:45Can you switch
- 39:20Hybrid Dictionary
- 41:31Summary
- 42:22Questions
related talks
43mPragmatic Performance: When to care about perf, and what to do about it.
47mSolving .NET performance issues
37mRock Your Code Code and App Performance for Microsoft .Net
47mUnlocking Performance Improvements in .NET
01h 04mTurbocharged: Writing High-Performance C# and .NET Code
46mDeep dive into .NET performance and native AOT
59mPerformance tricks I learned from contributing to open source .NET packages
01h 06m.NET Systems Programming Learned the Hard Way
