Tuesday, October 19, 2021

4 Take-aways for .NET Dictionary

Background: .NET has four built-in dictionary/map types.

Here are some take aways. 

  1. Hashtable - Avoid use hashtable because it is weakly typed.
  2. Dictionary<T> - Hashtable strongly typed replacement. Not thread safe
  3. ConcurrentDictionary<T> - Good read speed even in the face of concurrency, but it’s a heavyweight object to create and slower to update.
  4. ImmutableDictionary<T> - No locking required to read but more allocations require to update than a dictionary.

No comments:

Be A Developer That Uses AI

Developers will not be replaced by AI, they'll be replaced by developers that use AI. Generative AI tools are revolutionizing the way de...