← Back
Nick Chapsas October 17, 2025 38s

Fast Dictionary is awesome in .NET

Summary

This transcript discusses an advanced technique for efficiently updating dictionaries in .NET without extra lookups or copying. The key method involves using Marshall.GetValue with a ref or add default approach, which provides direct access to the value slot in a dictionary. This approach allows for in-place mutation of existing keys or initialization of new keys, but comes with a caveat that it should be used carefully and briefly due to potential resizing risks. The practical takeaway is a performance optimization strategy for dictionary manipulation in .NET programming.

View original episode ↗