How I wasted one our of my time :-)

Stefan Matthias Aust sma at 3plus4.de
Thu Jun 15 21:46:14 UTC 2000


At 00:13 16.06.00 +0300, Daniel Vainsencher wrote:

>Anyway, food for thought:
>On my system,
>#(Set IdentitySet Dictionary IdentityDictionary) collect: [:e | c _
>(Smalltalk at: e). {c allInstances size. (c allInstances select: [:i | i
>size > colSize]) size}]

You might want to consider #count: instead of #select: and 
#size.  #instanceCount is also better than #allInstances and #size ;-)

I btw go different numbers, much less Sets, in my current working image. I 
also checked MethodDictionary instances (last column).

 >100    #(#(32 1) #(2026 0) #(1142 6) #(2453 1) #(2550 31))
 >10     #(#(20 5) #(2026 0) #(1142 130) #(2453 118) #(2550 672))
 >5      #(#(23 6) #(2026 0) #(1142 300) #(2453 247) #(2549 1018))

What I don't understand is why does the number of MD instances change 
during the tests.  And why is

  Smalltalk allClasses size * 2  --> 2530

that is, what's the

>I wonder at what size hashing becomes faster than a linear search...

This probably depends on both the speed of #= and #hash.  I'd guess (from 
earlier experiments with VisualWorks) that the break even is around 10-20.

bye
--
Stefan Matthias Aust  //  Bevor wir fallen, fallen wir lieber auf





More information about the Squeak-dev mailing list