I am currently using Hashtable to store a list of unique identifiers and related data, all of which are read from a file.
The length of this data file can be very large: from 1 to several hundred thousand. I noticed a significant slowdown in the speed of adding entries to the Hashtable when about 50,000 entries passed.
I think setting the initial capacity may help, but obviously I can't know this number, as the data is being read from the file. Could someone suggest a way to speed up the addition of a large number of entries, or is this behavior pretty normal?
edit: Now I just use Hashtable. I think this should probably be Dictionary <string, MyDataObject>, but this seems like a separate issue.
source
share