Demo: Boxing And Unboxing In Intermediate Language
We use .NET Insights to inspect the compiled DLL, locate the explicit box and unbox IL instructions in the main method, and demonstrate how these two redundant memory copy operations survive compilation and would execute millions of times unnecessarily inside a tight loop.
Previous Module
.NET Runtime Memory Management
This Module
The .NET Type System