Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Multi-Minute Startup?



On 2008-08-14 at 15:08 +0200, Richard Hartmann wrote:
> On Mon, Aug 11, 2008 at 17:29, Dan Nelson <dnelson@xxxxxxxxxxxxxxx> wrote:
> > Raise suggested-size to 1601 (a prime number larger than your current
> > list size with some room to grow).
> 
> Using a prime hints at an interesting reason. What is it?

General hashing algorithm theory.  I forget the math (if I ever knew
it); also, there's a lot of heuristics in there ("that seems to work,
let's go with that").

You tend to not be hashing completely random data and in the absence of
distribution information about the input data, bucketing into a prime
number of slots tends to cause the least pain.

You'll find prime number requirements for many hash bucketing schemes.

-Phil, who should have made more effort to stay awake that lecture



Messages sorted by: Reverse Date, Date, Thread, Author