Strange hash behaviour

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange hash behaviour

Romain Robbes-2

        Hi list,

I just stumbled upon this:

Object new hash 3698
OrderedCollection new hash 183475190

Hashes for collections seems to be much bigger than other hashes. Is  
there a reason for that?

Cheers,
        Romain

Reply | Threaded
Open this post in threaded view
|

Re: Strange hash behaviour

Bert Freudenberg
On Nov 30, 2006, at 11:36 , Romain Robbes wrote:

>
> Hi list,
>
> I just stumbled upon this:
>
> Object new hash 3698
> OrderedCollection new hash 183475190
>
> Hashes for collections seems to be much bigger than other hashes.  
> Is there a reason for that?

Sure. Look into the implementation of #hash that is used by  
OrderedCollection.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Strange hash behaviour

Philippe Marschall
In reply to this post by Romain Robbes-2
Actually hashes for "normal" objects should be bigger in 3.9 so that
you can have more than 4096 elements in a Dictionary or Set with
degrading performance.

A quick check showed that the fix is no longer present in the image :(

http://bugs.impara.de/bug_view_advanced_page.php?bug_id=1876

Philippe


2006/11/30, Romain Robbes <[hidden email]>:

>
>         Hi list,
>
> I just stumbled upon this:
>
> Object new hash 3698
> OrderedCollection new hash 183475190
>
> Hashes for collections seems to be much bigger than other hashes. Is
> there a reason for that?
>
> Cheers,
>         Romain
>
>