High-performance code design patterns in C#
summary
Proposes a named set of performance patterns for modern C# and .NET: Span<T> and Memory<T> for zero-copy slicing, ArrayPool and object pooling to cut allocations (benchmarks show almost twice faster than new-array baselines), stackalloc-backed buffers that beat pooling by over 50%, a struct-of-arrays layout that can be ~10× faster for hot loops, and buffer/builders (value string builder) that drop GC time from ~70% to ~10% while greatly raising throughput.
AI-written summary · about
chapters (17)
- 0:00Start
- 1:15What Is High Performance in C-Sharp
- 4:37Design Patterns
- 10:39Array Pool
- 13:42Abstract Memory Pool
- 24:02Struct of Erase
- 27:52Sequential Layout
- 29:16Object-Oriented Design Patterns
- 31:54Stack Based Data
- 39:43Fixed Size Buffers
- 42:07Buffer the Builder
- 43:20String Builder
- 46:19Value String Builder
- 46:29Ref Struct
- 46:50Initial Buffer
- 49:58Questions
- 51:39Is There any Point When We Should Stop Optimizing Dotnet Code and Just Write Nice that Not Compatible C + + Library
related talks
01h 00mIntroduction to Hardware Efficiency in Cpp
56mC++ Relocation - How to Achieve Blazing Fast Save and Restore and More!
05mWhen every Microseconds counts: Lessons learned about performance
01h 03mTaming dynamic memory
01h 05mThe Most Important Optimizations to Apply in Your C++ Programs
01h 09mComputer Architecture, C++, and High Performance
01h 02mDeveloping Kernel Drivers with Modern C++
32mThe Impact of Memory Allocators on Performance: A Deep Dive
