New method cache, 30% faster macrobenchmarks and ineffeciencies.

Stephan Rudlof sr at evolgo.de
Sun Dec 9 21:38:54 UTC 2001


Scott A Crosby wrote:
> 
> The benchmarkings..
> 
> Its hard for me to believe it now, but I never did actually benchmark my
> new methodcache on macroBenchmarks. OOPS!
> 
> Now that I've done it, I'm very impressed. I never realized that I got a
> 30% gain across the board. (And, maybe higher, I should probably retest
> new different-sized caches and see if there's an even higher improvement)

Wow! Congratulations!

> 
> These are on a stock 3.1a-4164 image. I am also running the minimal
> changes in order to get it running with my interpreter binaries. Here are
> the results:
> 
> Stock VM:                                          373 seconds.
> VM with my method cache[1]:                        265 seconds.
> VM with my method cache and collection changes[2]: 256 seconds.
> 
> I never benchmarked macroBenchmarks with/without my new method cache..
> Oops.. I'm impressed.
> 
> My collection changes were discounted on the list and may be obsolete...

Why?

One remark:
There are just 12 hash bits in the object header, an identityHash has to be
consistent with the hash stored there (at least for MethodDictionaries, look
for #hashBitsOf: in Interpreter>>lookupMethodInDictionary:).
But for ordinary - not VM related - hashed collections an alternative hash
scheme with VM support (named #longHash?) could make sense. And the use of
e.g. 4097 (as you have suggested in one mail) instead of 4096 as factor
avoids penalizing small collections (especially bad with power 2 sizes
then)... The time consumption in the VM would be negligable here.

Greetings,

Stephan

> When I rebuild my next image, I'll probably omit them.
> 
> Anyways, go check it out, a few emails ago....
> 
> [1] This VM also contains some irrelevant changes to String.
> [2] These include my small changes to sortedcollection, they need cleanup
> by someone who knows 'the smalltalk way'(tm) better than I do. :) These
> changes only help macroBenchmark1, and do not affect the others much.
> 
> --

...

> Scott

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3




More information about the Squeak-dev mailing list