Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: (Ovid) Re: Comparing two hash tables

by PrakashK (Pilgrim)
on Mar 29, 2002 at 04:43 UTC ( [id://155198]=note: print w/replies, xml ) Need Help??


in reply to Re: (Ovid) Re: Comparing two hash tables
in thread Comparing two hash tables

The reason why i am trying to delete the similar keys is that gradually the the search for the next similar would become faster owing to lesser number of keys left
The time to access a hash member does not depend on the number of keys, but on whether the distribution of the hash keys into the buckets is uniform or not.

/prakash

Replies are listed 'Best First'.
Uniform distribution of keys in the buckets
by Anonymous Monk on Mar 29, 2002 at 14:45 UTC
    So how can i ensure whether the distribution of keys in the buckets is uniform or not ? Please suggest Thanks

      The following will give you some information about the hashing:     print scalar %hash; See perldata for information: search for "bucket":

      This is pretty much useful only to find out whether Perl's internal hashing algorithm is performing poorly on your data set. For example, you stick 10,000 things in a hash, but evaluating %HASH in scalar context reveals `"1/16"', which means only one out of sixteen buckets has been touched, and presumably contains all 10,000 of your items. This isn't supposed to happen.

      However, this probably won't help you because you have no control over the hashing mechanism.

      Ultimately, the only way for you to answer your question is to use Benchmark.

      --
      John.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://155198]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-03-19 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found