identityHash benchmarks (for the doubters)

Scott A Crosby crosby at qwes.math.cmu.edu
Thu Dec 13 04:32:23 UTC 2001


Good suggestion Doug.. For the doubters of my patch, here are actual
benchmark results with and without it.

I make a simple set and add a bunch of Object's to it.

Time millisecondsToRun: [x _ Set new. 0 to: 50000 do:
   [ :ignored | x add: Object new ] ].


Number		Old code	Mine
   2000		     34		    33
   5000		   4094		   101
  10000		  63071		   234
  20000		 372764		   486
  40000				  1272
  80000				  3561
 240000				 16501
1000000				235952

The blank entries are where I am too impatient to wait for it to complete,
but you get the idea. [*]

Roughly, for sets >5000 elements, I can handle a set 20-30 times larger in
the same amount of time as the current code.  (Or, for a set of the same
size, I'll be about 1000x faster) For example, I handle a set of 80,000
elements in less time than it takes for the old code to handle 5,000
elements.

If the 'Set' class is used in object-serialization, unlike the current Set
implementation, I can seralize 20,000 objects in well under a second.

BTW, this benchmark was done using a multiplier of 4097. The results would
not degrade if we had a multiplier of 135859, as I now suggest.

Scott

PS. Independent of this identityHash patch, Andraas, if you don't mind, I
think I'll integrate your two GC patches together with my own changes and
submit a single fix for the list?


[*] To complete the table would take about 5 days of computation with the
old code.





More information about the Squeak-dev mailing list