identityHash patch discussion.

Lex Spoon lex at cc.gatech.edu
Fri Dec 14 01:48:32 UTC 2001


> Yes. All objects in squeak have 12 bits in their header that form the
> default hash of that object. (Though identityhash).
> 
> The problem is that those bits are used as-is, to construct a number in
> the *specific* range 0...4095, which is used as the starting index in
> Set>>scanFor: This flaw means that *any* set and *any* dictionary that has
> >4000 elements in it will devolve into a linear search through all of the
> elements, when it could be 4000 times faster.
> 
> This is *not* a problem in there being only 12 bits in the object header,
> but that those 12 bits are interpreted as values in the *specific* range
> 0...4095.

Well, if there were more than 12 bits available, then that would solve
the problem as well, yes?  So which is the "real" problem, hmm?  :)


-Lex




More information about the Squeak-dev mailing list