Hash rehashed (was: [SqF]Report of VI4 Project for Feb '02)

Lex Spoon lex at cc.gatech.edu
Tue Feb 5 18:16:14 UTC 2002


Just to toss a few more rocks on this mountain of a molehill:

1. The interface could be changed to #identityHashForSize:, and
different multipliers or implementations could be used for different
collection sizes.  Incidentally, this makes a lot of sense for regular
#hash, as well -- I am often stumped by how much effort to put into a
hash calculation, because it really depends on how large of a collection
your objects will find themselves in.

2. There could be an optional extra header word to hold a larger hash. 
The first time it is requested, becomeForward: the underlying object and
add the header.  Now we can have full 32-bit hashes whenever collections
get very large.  While this sounds wasteful, it's a slight improvement
on what people do now: they add an instance variable for the larger hash
manually, thus using up extra space whether or not the particular object
is ever put in a large collection.



-Lex



More information about the Squeak-dev mailing list