Such a small benchmark

David Griswold David.Griswold at acm.org
Fri Oct 18 19:12:34 UTC 2002


"Andreas Raab" <Andreas.Raab at gmx.de> wrote:
> Viktor,
>
> > Producers of Dolphin Smalltalk (www.object-arts.com) said
> > theirs Smalltalk is pure interpreter too.
>
> Oh sure it is, but your benchmark is no good. What you are
> measuring is
> a specific optimization - namely whether the compiler inlines
> #timesRepeat: messages or not. To prove that point I've copied the
> message timesRepeat: in Dolphin, VW, and Squeak and renamed it
> #timesRepeat2: (to prevent the compiler recognizing it). Let's have a
> look at the results when we use timesRepeat: or timesRepeat2:
> with your
> code (taken on a 1.2GHz P3):
>
> 		timesRepeat:		timesRepeat2:
> VW			 380ms			 680ms
> Dolphin		1311ms			3447ms
> Squeak		3351ms			3358ms
>

Andreas,

The Strongtalk compiler does not do any special optimization for
timesRepeat:.  It is able to inline it without a special case, using the
general inlining heuristics.  So it should be just as fast with
timesRepeat2:.  The benchmark is a perfectly fair one (for a
microbenchmark) for Strongtalk- it is all the *other* implementations
that are "cheating" :-).

#timesRepeat: is implemented using to:do:, which is also inlined without
a special case using the general algorithm.  to:do: is implemented using
whileTrue:, which is the single primitive iteration construct in
Strongtalk.

So, to make the benchmark really fair, you should disable the special
handling of timesRepeat: for all the other systems.  This would make the
Strongtalk system's time of 45 ms appear to be even faster, relatively.

-Dave





More information about the Squeak-dev mailing list