SortedList vs HashTable: Insertion
Monday 10 June 2002
In a completely unscientfic test, when adding the same collection of randomized key/value pairs to instances of HashTable and SortedList (using the default constructors for both classes), the former wins for large collections and the latter for small collections. The break-even point in my test program is in the order of 3000 pairs. However the performance of SortedList degrades in a non-linear fashion going above this number. Ensuring the initial capacity of the SortedList is sufficient for the whole collection does not make a difference to this.
Posted by
at 07:21 PM.
Permalink.
Copyright © Charles Cook.
Valid XHTML 1.0