Performance of hashes and associative arrays
Manfred Nowak
svv1999 at hotmail.com
Sat Nov 17 09:46:57 PST 2012
Raphaël Jakse wrote:
> Is compressing for performance reasons?
Hopefully. Because in the general case the distribution of the
keys is unknown, no function used for computing the hash value
can be guarenteed to indeed spread the hash values uniformly
over the hash interval.
Compressing would have a negative effect on performance if more
time for compressing and decrompessing would be needed than time
was lost for resolving conflicting hash values.
> is it more interesting to compress and then hash than just
> hash ?
The only purpose of compressing is to create the special case of
close to no redundancy in the keys used for hashing. If this
special case is already confirmed or it is known that no
compression will deminish the computing time: just hash.
-manfred
More information about the Digitalmars-d-learn
mailing list