Hi All...
I dont know whether this is the right place to post a datastructure problem
or not (if not please some one redirect)
I am using hashmaps in vc++. i have one particular use of the map for which
the performance is very slow.
Say i have 100 items in the map. The required operation is to update all the
keys in the map (KEYS and not the mapped data).
This operation is taking around 35 seconds for 300 such updates with .net
platform (which is actually very slow for my app).
Can somebody point me towards a better data structure or even the way hash
map/tables are implemented in .net.
Thanks in advance,
Ubhay.
Carl Daniel [VC++ MVP] - 29 Jun 2004 15:57 GMT
> Hi All...
> I dont know whether this is the right place to post a datastructure
[quoted text clipped - 10 lines]
> Can somebody point me towards a better data structure or even the way
> hash map/tables are implemented in .net.
If you're getting bad performance from a hash map you probably have an
inappropriate hash function for your key set.
Note that updating keys in a map is accomplished only by erasing and
re-inserting the key/value pairs - there's no way to directly modify a key
value (since doing so would violate the invariants of the map).
If you can post some more information about how you're using the map,
someone can probably shed more light on the source of your performance woes.
-cd