473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Fast hash lookup

2
Hi!

I am using c++ stl hash_maps in my program. My hash_map is ~1million entries of <int,T*>. The default hash function is very slow, ~60m hash_map lookups are taking several hours.
Does any one have a suggestion for faster hash lookup?

Thanks!
Apr 5 '08 #1
2 1938
weaknessforcats
9,208 Expert Mod 8TB
Have you compared this to a regular map?

Or, have to tried to write your own compare function?

With this many entries you might also look at a chain-link table.
Apr 5 '08 #2
gpraghuram
1,275 Expert 1GB
Hi!

I am using c++ stl hash_maps in my program. My hash_map is ~1million entries of <int,T*>. The default hash function is very slow, ~60m hash_map lookups are taking several hours.
Does any one have a suggestion for faster hash lookup?

Thanks!

Try to use bit wise operators in the compare function .
I think it will have some improvements

Raghuram
Apr 6 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Ville Vainio | last post by:
I need a dict (well, it would be optimal anyway) class that stores the keys as strings without coercing the case to upper or lower, but still provides fast lookup (i.e. uses hash table). >> d...
2
by: Brian Genisio | last post by:
Hello all, I need to use a hash table for quick lookup... What is the best way to do it? My current solution uses stl::map, where I essentially do the following (not compilable code): ...
4
by: Thomas Christmann | last post by:
Hi! First let me apologize for asking this question when there are so many answers to it on Google, but most of them are really contradicting, and making what I want to do very performant is...
12
by: wxs | last post by:
Many times we have a bunch of enums we have from either different enums or the same enum that will have various numeric values assigned. Rarely will there be collisions in numbering between the...
2
by: Ravi | last post by:
Hi, I am working on a winform app. I need to use an object which can store some information(key/value pairs) and also can be acessed by multiple threads(read/write). From what I heard Hash table...
9
by: lars_woetmann | last post by:
I have a list I filter using another list and I would like this to be as fast as possible right now I do like this: i tried using the method filter: filter(lambda x: x not in list2, list1)
1
by: bhups | last post by:
hi, i am doing a lookup using hash table. I have a pipe delimited file that i have to search for a new invocie number field by checking of an old invoice number-customer number key combination...
11
by: Douglas Dude | last post by:
how much time does it take to lok for a value - key in a hash_map ? Thanks
2
by: Spoon | last post by:
Hello, I'm wondering whether the STL defines a data structure with the following features: o provides push_front() and pop_back() (like std::list) to implement a FIFO buffer. o allows fast...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.