Benching #Smalltalk vs Squeak
John Brant
brant at refactory.com
Tue Nov 25 15:13:10 UTC 2003
> From: squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-dev-
> bounces at lists.squeakfoundation.org] On Behalf Of goran.krampe at bluefish.se
>
> "John Brant" <brant at refactory.com> wrote:
> > > From: squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-
> dev-
> > > bounces at lists.squeakfoundation.org] On Behalf Of
> goran.krampe at bluefish.se
> > >
> > > If we look at SlopStone (I just used the "Benchmark" package on SM -
> not
> > > sure if it is the same code that SharpSmalltalk includes in its
> > > download, but I guess it is) it seems that .Net shines on adding
> floats
> > > (11 times faster), creating objects (7 times faster) and evaluating
> > > blocks (31 times faster).
> >
> > Yes, both are ports of Bruce Samuelson's benchmarks. I ran the tests a
> few
> > months ago, and #Smalltalk was faster than Squeak on all of the
> Slopstone
> > and Smopstone benchmarks except adding integers and forming sets.
>
> Yes, I only mentioned those where Squeak got really "squashed" since
> those might be interesting to understand the reasons why.
Most likely the reasons will be the difference between a jitter VM and an
interpreted one. One benchmark that was interesting was generating strings.
I would have expected Squeak to be faster. This test prints all integers
from 1 to 8000 and then reverses the print string. Since strings are
immutable in .NET, the reverse method makes n+1 copies of a string that is n
characters long.
It appears that Squeak's printing of Integers is quite a bit slower than
#Smalltalk's. I would expect the SmallInteger printing to be somewhat
slower, since I defer to .NET for printing, but LargeInteger printing
shouldn't be. In particular, if printing 1000 factorial in #Smalltalk takes
10ms, but doing that in Squeak takes 1.3 seconds.
> Ok - but I also got very confused about the numbers - it didn't seem
> like the smopstone number and the execution times are... properly
> "related". But I didn't dig into it. :)
>
> For example:
>
> SSt+MS.net
> 0,6909936 22,8439163546522 generating fractonaccis
> 0,75108 20,577035735208 generating strings
>
> Squeak
> 0.499 6.32665330661323 generating fractonaccis
> 0.187 16.52941176470588 generating strings
>
> So... isn't short time = higher smopstone? For some tests it seems to
> be, and not for others.
Look at the repetition count. In Squeak they are only running once, but in
#Smalltalk they are running 5 times.
> Btw, how do *you* write SharpSmalltalk programs? I mean, what IDE do you
> use?
I use VisualWorks. I define #Smalltalk in its own namespace and have scripts
that will export the packages. I also have some code that allows me to
quickly port other VisualWorks packages to #Smalltalk.
John Brant
More information about the Squeak-dev
mailing list
|