[squeak-dev] Re: About Collections-ul.137..140
Levente Uzonyi
leves at elte.hu
Mon Sep 21 19:27:09 UTC 2009
Hi!
On Mon, 21 Sep 2009, Andreas Raab wrote:
> Can you please post the benchmarks that you are using to determine what
> "faster" sets mean?
>
> Thanks,
> - Andreas
>
Faster means that #grow and #rehash are faster. And because #grow is
faster #add: is slightly faster too.
Here is a quick benchmark:
[
| array1 array2 |
array1 := (1 to: 100000) asArray.
array2 := array1 shuffledBy: (Random seed: 12345).
{ array1. array2 } collect: [ :array |
(1 to: 5) collect: [ :each |
Smalltalk garbageCollect.
[
| s |
s := Set new.
{
[ s addAll: array ] timeToRun.
[ s rehash ] timeToRun } ] value ]
] ] value
And the results (on my notebook):
"trunk (Collections-nice.135)"
#(
#(
#(208 101)
#(217 107)
#(206 91)
#(205 102)
#(206 102))
#(
#(2926 104)
#(2918 101)
#(2926 92)
#(2926 100)
#(2923 103)))
"trunk + FastSetsFileInFirst-rpb.8 FastSets-rpb.9 from squeaksource"
#(
#(
#(154 38)
#(158 37)
#(157 47)
#(150 37)
#(157 47))
#(
#(2848 38)
#(2836 38)
#(2849 37)
#(2849 38)
#(2838 38)))
"trunk + Collections-ul.137..140"
#(
#(
#(143 31)
#(146 31)
#(148 33)
#(151 31)
#(143 31))
#(
#(2826 31)
#(2806 42)
#(2823 31)
#(2843 31)
#(2834 31)))
Cheers,
Levente
More information about the Squeak-dev
mailing list
|