[squeak-dev] Re: Ideas about sets and dictionaries

Levente Uzonyi leves at elte.hu
Thu Nov 12 12:32:38 UTC 2009


On Thu, 12 Nov 2009, Igor Stasenko wrote:

>> a) Run benchmarks (tiny and macroBenchmarks). I expect no difference but I
>> only believe that after having run the benchmarks.
>>
> before:
> 1 tinyBenchmarks
> '436115843 bytecodes/sec; 12718765 sends/sec'
> '473635522 bytecodes/sec; 12718765 sends/sec'
> '473635522 bytecodes/sec; 12727537 sends/sec'
>
> after:
> 1 tinyBenchmarks
> '472324723 bytecodes/sec; 12657701 sends/sec'
> '472324723 bytecodes/sec; 12683800 sends/sec'
> '472760849 bytecodes/sec; 12969029 sends/sec'

Well, I doubt Andreas ment to use Integer >> #tinyBenchmarks, because it
doesn't use sets. I think he ment microbenchmarks like this one:
http://leves.web.elte.hu/collections/Set%20class-microBenchmark.st

I just ran them with the current implementation, 2a and 3c, the results 
are here: http://leves.web.elte.hu/collections/SetBenchmarkResults.txt
The values are microseconds/element in the table (smaller valuesa are 
better).

I summed up the rows and created a table (smaller numbers are better):
 	trunk	2a	3c
add: (included)	2,594	2,599	2,443
add: (not included)	9,370	9,957	9,441
includes: (included)	2,869	2,961	2,822
includes: (not included)	3,685	3,717	3,671
like: (included)	2,446	2,486	2,508
like: (not included)	3,268	3,258	3,310
rehash	2,924	2,841	2,238
remove:ifAbsent: (included)	7,190	7,228	7,240
remove:ifAbsent: (not included)	3,966	3,980	3,856

I don't see any real differences. Some values are pretty strange (like 
rehash at 3c, I expected it to be slower than trunk). It may be because 
of noise, even though I tried to avoid noise as much as possible.

Since these benchmarks show no significant differences, I doubt that 
macrobenchmarks would show any differences for these implementations.

Levente



More information about the Squeak-dev mailing list