http://www.perlmonks.org?node_id=1056404


in reply to Re^5: Truly randomized keys() in perl 5.17 - a challenge for testing?
in thread Truly randomized keys() in perl 5.17 - a challenge for testing?

Thank you for your answer.
Seems I found original discussion
and it seems that was just optimization of previous algorithm overhead:
Perl currently has a defense against attacks on its hash algorithm where it conditionally enables the use of a random hash seed when it calculates the hash value for a string. This mode is triggered by encountering an overly long bucket chain during insert. Once this bit is set all further hash operations have to go through additional layers of logic. All of this support has a per-operation cost.
The rehash mechanism more or less works around the problem of hash order expectations by only enabling the randomization in degenerate hashes. But it achieves this at the cost of added per operation overhead in hot code paths and additional complexity in the code.

Replies are listed 'Best First'.
Re^7: Truly randomized keys() in perl 5.17 - a challenge for testing?
by BrowserUk (Patriarch) on Sep 30, 2013 at 19:02 UTC

    Like I said. I read everything related I could find. Including that.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.