System.Collections.SortedList performance
"Everything changed, when you are add scale."One of thing which changed is performance requirements. I saw a set of classes in System.Collections and System.Collections.Specialised namespaces and really never thinked about differences between them.
It was trivial that ListDictionary faster SortedList or HashTable on small amount of data (<10), but actually I never used HashTable and didn't think about what it is.
Today i wrote simple Aspect Oriented Idea test and when playing with performance I accidentally found that HasDictionary is twice faster (for my case) than normal SortedList. (Key was Guid)
Such small changes - to compare hashCodes instead of key values could significantly increase performance of your system if it makes a lot of search operations.
Result: use SortedList only when you need really ordered values.
Applies to all dotnet languages: C#, VB.NET, C++.NET, J#

0 Comments:
Post a Comment
<< Home