.rehash

bearophile bearophileHUGS at lycos.com
Tue Sep 30 14:55:07 PDT 2008


dsimcha:
> Rehash is nice, in my experience, for the specific but common usage case of
> dumping tons of data into an AA, and then using it for lots of read-only access
> after it's been built.  Hash collisions greatly hurt the performance of AAs.
> Rehash basically increases the hash space if necessary, to lessen hash collisions
> at the price of slightly more memory usage and some upfront processing time.  This
> happens anyway occasionally as your AA gets larger, but calling .rehash makes it
> happen explicitly.

Have you timed your real programs (not benchmarks) and seen an actual improvement of their global running times?

Bye,
bearophile



More information about the Digitalmars-d mailing list