Do Less Work by Not Wasting Effort, Example 1 Initialize the collection size Do Less Work by Not Wasting Effort, Example 2 Retain the reference to the cache entry
Tag: performance
Writing Allocation Free Code in C# By Matt Ellis
Twitter: @citizenmattGitHub: https://github.com/citizenmatt/RefSemantics Always be measuring – don’t do it because you think it’s the right thing to do. It might not be. Managed memory is cheap. That’s not true, allocation is cheap and garbage collection is expensive. Garbage collection stops the world while things are cleaned up and optimized. Sometimes memory cleanup can impact…