Solved

stl,map-find,going slow.

Posted on 2003-10-24
3
541 Views
Last Modified: 2007-12-19
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







 
0
Comment
Question by:hirosh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
mtmike earned 125 total points
ID: 9614044
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question