Idea for a possibly better Collection occurrencesOf method.

Bryce Kampjes bryce at kampjes.demon.co.uk
Wed Sep 13 22:57:13 UTC 2006


Klaus D. Witzel writes:

 > > I suspect that implementing #apply:from:to:on: in Squeak is a mistake.
 > 
 > A possible performance improvement by a factor of 3 is not what people  
 > would count a mistake.

Here are some numbers from Exupery now:

  arithmaticLoopBenchmark 1376 compiled   92 ratio: 14.957
  bytecodeBenchmark       2201 compiled  430 ratio:  5.119
  sendBenchmark           1580 compiled  691 ratio:  2.287
  doLoopsBenchmark        1069 compiled  729 ratio:  1.466
  largeExplorers           372 compiled  432 ratio:  0.861
  compilerBenchmark        807 compiled  812 ratio:  0.994

The first column of numbers is the time in milliseconds to interpret
the benchmark. The second is the time to run the compiled
benchmark. The third is the ratio between the two.

arithmaticLoopBenchmark is a simple 1 to: do: loop. It's just
SmallInteger additions and looping.

bytecodeBenchmark and sendBenchmark are the two tiny benchmarks.

doLoopsBenchmark is a basic do: loop, the time is almost certainly
going into the call from compiled code to value:. value: is currently
implemented by calling ExuperyBlockContext>>value: which is
implemented in Slang. Re-implementing as compiled code will speed that
up.

Improving send performance by a factor of 2.2 is done now so long
as both the receiver and sender are compiled.

largeExplorers and compilerBenchmarks are two macro benchmarks. Both
spend a lot of time in primitives. Enough that speeding up the do:
loop execution doesn't seem to matter. I haven't done that much
experimentation with these benchmarks recently. It's possible that
they may benefit from a different compilation strategy.

Bryce

P.S. This is all the answer I have time to write tonight. Hopefully,
it provides something to think about.



More information about the Squeak-dev mailing list