The Dictionary(Of TKey, TValue) and ConcurrentDictionary(Of TKey, TValue) provides same functionality like Hashtable. But a Dictionary(Of TKey, TValue) of a specific type (other than Object) provides better performance than a Hashtable for value types. This is because the elements of Hashtable are of type Object; therefore, boxing and unboxing typically occur when you store or retrieve a value type.
The ConcurrentDictionary(Of TKey, TValue)class should be used when multiple threads might be accessing the collection simultaneously.Though Hashtable Synchronized method is thread safe for multiple readers and writers, but in performance point of view ,boxing and unboxing decreases the score of Hashtable.The Same theory applies in Generic List and ArrayList. Generics always Generic...!
Published under: Microsoft .NET Tips · · · ·
Thank you I think that needed to be said. Now that I look at what you said it seems obvious but it was good to point out.