[ENH] Ten Percent Faster Morphic! (with conversion)

Ned Konz ned at bike-nomad.com
Tue Aug 6 18:02:50 UTC 2002


On Tuesday 06 August 2002 09:44 am, Henrik Gedenryd wrote:
> So I suggest that a much simpler solution/smaller change is to
> instead add a primitive for scanFor:, to which you pass the hash
> value to use

But wouldn't that force the hash to be generated/accessed? With my 
optimizations, hash is skipped altogether; I'm just doing a linear 
identity scan.

Depending on whether the (hash mod: size) operation is costly, it 
might make sense to do this in the primitive as well.

Perhaps two methods:
Array>>identityScanFor:startingAt:  (linear search from given start; 
wrap at end)
Array>>identityScanFor:hash: (generate index first then do same as 
above)

> so you can use the same one also for regular
> dictionaries. It should be possible to refactor the code for the
> message lookup of the vm, in
> Interpreter>>#lookupMethodInDictionary: , into something like
> lookupKey: key startingAt: index .

well, that's a bit specialized, in that it stops at the first nil.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list