[OT] The horizon of a stream
bearophile
bearophileHUGS at lycos.com
Thu Oct 23 13:56:29 PDT 2008
Andrei Alexandrescu:
> Under what circumstances it does well vs. not so well?
Assuming that the hash function is good, very similar strings too have different hash values.
When there are lot of equal lines it doesn't work well, I presume, because there are lot of equal hash values.
Note that in our example the lines are very short, so replacing them with a hash_t (as the key of the associative array, so it stores this value two times, because it keeps the hash of the hash value too, that being probably a size_t or uint, is hashed to itself) doesn't save you that much RAM.
Bye,
bearophile
More information about the Digitalmars-d
mailing list