|
|
Question : stl,map-find,going slow.
|
|
i am using stl hash_map to store 2 strings,first the map is empty,then i need to chek if the first string is on the map,if i find i need to take the second one and process,else i need to do some processing and find the second string and insert into map, my problem is the find going slow when data is increzed ,it is realy going so so slow, any other way to do the same thinks?any other methods to improve the speed, any other altarnative to maps?to increze speed?i just want to do the same thinks thanks
|
Answer : stl,map-find,going slow.
|
|
Hash maps are usually the fastest way to do associative lookups unless you're using an unsuitable hash function. Try using a normal map instead of a hash_map and see if performance improves. If it does, the hash function is likely to be the problem.
|
|
|
|
|