develooper Front page | perl.perl5.porters | Postings from October 2012

Re: Eliminating the "rehash" mechanism for 5.18

Thread Previous | Thread Next
From:
Ævar Arnfjörð Bjarmason
Date:
October 29, 2012 17:42
Subject:
Re: Eliminating the "rehash" mechanism for 5.18
Message ID:
CACBZZX5MaQqYpsyKd7a_rTabUyM3CNYmjEgPCDFYb=WxhC5DZA@mail.gmail.com
On Mon, Oct 29, 2012 at 7:03 PM, Jesse Luehrs <doy@tozt.net> wrote:
> On Mon, Oct 29, 2012 at 06:55:21PM +0100, demerphq wrote:
>> What do people think?
>
> We have had to deal with this issue for quite some time in Moose - minor
> changes to internal implementation details can change the order that
> things are inserted into hashes, causing hash iteration order to change,
> and this ends up looking like a Moose bug when in reality it's because
> people are relying on hash iteration order in general staying
> consistent. If hash iteration order is always random on a per-invocation
> level, these bugs will never be able to be introduced in the first
> place, which would save a lot of pain when refactoring things.

I fully agree with this proposal, and I think this point Jesse raised
is really important.

By randomizing the seed on startup we're immediately breaking code
relying on undefined behavior that would have broken eventually in far
more subtle ways.

If that was all this proposal was about I think it would be worth it,
but speedups in the hash code and the ability to have extra hash
algorithms is just more icing on the cake.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About