This question is primarily for Gisle Aas and Martin Thurn, the Lady and Lord Wizards of All Things Hash-ly, but all are welcome to contribute wisdom...

In an article I was linked to by Martin (http://www.perl.com/lpt/a/679) the author, Abhjit Menon-Sen, recommends that hashes be given bucket counts "Using a prime number that is not too close to a power of two..." Well, that's all well and fine but, according to perldoc, the keys(%hash) function, when used to preallocate buckets, rounds its assigned value up to the nearest power of two. That is:

keys( %baz) = 191;

will allocate 256 buckets (the next nearest 2n) to %baz.  So how do I follow Menon-Sen's recommendation when the behavior of keys() blatantly contradicts it? Is there nothing to be done?

Deane Rothenmaier
Systems Architect
Walgreens Corp.
847-914-5150

"Truth is eternal, knowledge is changeable.  It is disastrous to confuse them." -- Madeleine L'Engle
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to