Writing high performance code in .NET
summary
Builds a reactor platform that hosts a billion queries in memory across hundreds to thousands of machines and uses Service Fabric, .NET and Rx. Uses PerfView, WinDbg+SOS, CLRMD to inspect dumps and realtime ETW traces. Finds a TraceSource listener causing a global lock that collapses QPS, AggregateException.ToString allocations filling logs, a blocked finalizer (zmq) leaking sockets, and a global timer lock from countless Task.Delay timers. Fixes include switching to EventSource/ETW for structured tracing, disposing native resources to avoid finalizers, cancelling timers, and swapping immutable dictionaries with Interlocked for fast config updates.
AI-written summary · about
chapters (20)
- 0:00Intro
- 0:27Building High Scale Event Processing in Bing
- 1:59Performance Engineering Strategy
- 3:36An Arsenal of Tools
- 6:59The Basics of WinDbg and SOS
- 7:38The Basics of CLRMD
- 8:36The Case of the Trace
- 11:40Huge Exceptions, oh my!
- 14:49Using EventSource
- 23:19The Case of the Stuck Finalizer Queue
- 27:01Another Case of the Stuck Finalizer Queue
- 29:08Unobserved Task Exceptions
- 32:18Costly Timers
- 35:50Acquiring All Locks
- 38:34The Day all I/O stopped
- 43:36Using Singletons
- 46:48Subtle Sources of Boxing
- 49:55readonly, but with caution
- 51:53Immutable Data Structures
- 55:13The Lock-Free Publication Pattem
related talks
47mSolving .NET performance issues
01h 02mFrom ETW to EventPipe
01h 09mSherlock Homepage - A detective story about running large web services
48mPerformance in the .NET Runtime
01h 01mWhy your ASP.NET Core application won't scale
01h 03mApplication Performance Optimisation in Practice
01h 02mApplication Performance Optimisation in Practice
44m.NET Performance Investigation
