Faster dictionaries?
Andres Valloud
AVALLOUD at roadrunner.com
Fri Jul 20 09:35:00 UTC 2007
stephane ducasse wrote:
> it would be good to have a nice package with the different
> implementation.
> I think that speeding up Dictionary would also have an impact on the
> overall
> performance of squeak (to be verified). Now we never got the energy to
> push that.
> But if someone want to have a look this would be great.
Hey, talking about that... IIRC, the slang for hashMultiply was the
direct translation of the Smalltalk source code into C. However, the
Smalltalk code is just the small integer friendly version of * 1664525
bitAnd: 16rFFFFFFF (1664525 in decimal, or 16r65 and 16r260D in 14-bit
chunks).
So really, the primitive could just do * 1664525 while in the loop,
letting the unsigned long variable overflow into the void since the
result will be bitAnd'ed with a 28 bit mask anyway, and just do a last
bitAnd: at the end.
My 2 cents,
Andres.
More information about the Squeak-dev
mailing list
|