NameValueCollection vs. Hashtable performance considerations

Published 06 September 06 12:57 AM | ricom 

We had a good discussion on the NameValueCollection internally not too long ago and I asked my friends on the BCL Team to post a summary of the things that were discussed.  Kim Hamilton delivered and how.  Great tidbits like:

For example, when doing 40,000 lookups on a collection size of 100,000, NameValueCollection is about 2.6x worse:

NameValueCollection time: 0.050 sec
Hashtable time: 0.019 sec

 Check out the full article here.

 

 

Filed under:

Comments

# Jason Haley said on September 6, 2006 10:34 PM:
# Miral said on September 14, 2006 8:54 PM:
It strikes me as kinda funny, because FxCop goes out of its way to discourage use of the performance-oriented lists (like List and Hashtable) in favour of Collection and NameValueCollection.

I can see its point, though.  It's a tradeoff between performance and breaking the ABI if you need to add an event model.
New Comments to this post are disabled

Search

This Blog

Syndication

Page view tracker