Writing Zero-Allocation Code: Optimizing a Large Library
summary
This talk examines reducing heap allocations in a large existing .NET codebase by optimizing the SMBLibrary. It explains practical zero-allocation techniques (reuse, pooling, avoiding temporary allocations) to minimize GC pressure and shows how even simple operations can cause heavy allocation costs.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 2:37Memory allocations in SMB Library
- 8:55Performance impact tests
- 14:36Zero-allocation pooling
- 21:00Pooling and async trade-offs
- 27:24Advanced pooling techniques
- 34:09Refactoring large codebase
- 38:50Performance gains results
- 43:07Standardizing zero-allocation
- 50:16Demo: Zero-allocation LINQ
- 53:30Key takeaways
- 1:05:43Implementation steps
- 1:08:36Q&A
