Demo: Benchmarking Structs versus Classes
In this live walkthrough of the structs-vs-classes benchmark code, we compare memory allocation and garbage collector pressure between a list of value-type structs and a list of reference-type classes. The lesson uses the BenchmarkDotNet MemoryDiagnoser results to show that the class scenario uses 4x more memory than the structs scenario.
Previous Module
The .NET Garbage Collector
This Module
Memory Performance Optimizations