Simple method send benchmark vs Pharo

Chris Double chris.double at double.co.nz
Mon Dec 22 01:20:33 UTC 2014


I did a simple method test send benchmark vs Pharo Smalltalk and the
results on my Linux laptop show Self as being very slow. I'm wondering
if I'm perhaps doing something that's slowing things down.

The Self code is a simple object with two methods:

doSomething = ( ^ self )
test = ( |count <- 0 |
            [ count < 100000000 ] whileTrue: [
              count: count + 1.
              doSomething.
            ].

Running a timed test gives:

[ test ] time
 => 3000

So 3 seconds to run that.

Pharo code is almost exactly the same:

doSomething = ^self
test = |count|
          count := 0.
          [ count < 100000000 ] whileTrue: [
            count := count + 1.
            doSomething.
          ].

[ MyObject new test ] timeToRun
  => 0:00:00:00.239

So 239 ms vs 3000 ms. Quite a difference!

Is this just a stupid microbenchmark measuring different things problem?

-- 
http://bluishcoder.co.nz



More information about the Self-interest mailing list