Application Performance Optimisation in Practice
summary
Parses and sanitises SQL statements for OpenTelemetry, then iteratively targets hotspots using dotTrace, dotMemory and BenchmarkDotNet. Replaces expanding StringBuilders with ArrayPool + Span-based parser, switches per-call state to a stack-only refstruct, introduces small reusable buffers and a concurrent generic cache, removes substring allocations, and reruns unit tests and benchmarks after each change. Results show ~86% reduction in allocations and roughly 50% reduction in execution time in the demo, validated by profilers and benchmarks.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 0:53Why performance matters
- 1:57Premature vs reactive optimization
- 3:40Performance engineering
- 5:47Performance impact dimensions
- 8:15Optimization triggers
- 15:56Optimization loop
- 21:51Demo setup and SQL processor
- 26:00CPU profiling hotspots
- 31:13Memory profiling allocations
- 38:33Benchmarks and baselines
- 41:44First optimization string builder
- 43:31Reusing string builders
- 45:16HashTable to ConcurrentDictionary
- 48:02Span API substring
- 49:08ArrayPool and ref struct refactor
- 52:19Input comparison sanitization
- 54:04GitHub Copilot optimization
- 56:49Focus optimization efforts
- 58:32Stop optimizing validate
- 1:00:16Sustainable performance
related talks
01h 03mApplication Performance Optimisation in Practice
01h 03mTurbocharged: Writing High-Performance C# and .NET Code
01h 02mThe performance loop—A practical guide to profiling and benchmarking
01h 06mGet Better App Performance with this One Weird Trick
01h 02mPerformance tricks I learned from contributing to the Azure .NET SDK
57mPragmatic Performance: When to care about perf, and what to do about it
46mHigh Performance .NET
47mUnlocking Performance Improvements in .NET
