Fast hash lookup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mono12
    New Member
    • Mar 2008
    • 2

    Fast hash lookup

    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!
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    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.

    Comment

    • gpraghuram
      Recognized Expert Top Contributor
      • Mar 2007
      • 1275

      #3
      Originally posted by mono12
      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

      Comment

      Working...