[self-interest] Re: Simple method send benchmark vs Pharo

Russell Allen mail at russell-allen.com
Mon Dec 22 09:29:24 UTC 2014


Cute benchmark :)

Some thoughts:

Try closing the desktop and see how much of a speedup you get (i.e. 'desktop close', then run from the terminal). Morphic in Self is nowhere near as optimised as it could be. 

This is small integer stuff on both Self and Pharo, so I guess much of the time is spent in primitives?

In fact generally speaking, this code shows Self running many more messages than Pharo, as ‘count:= count + 1’ in Pharo sends very few messages.

(Is whileTrue in Pharo a true message send or is it byte code like ifTrue?)

Are ‘time’ and ‘timeToRun’ measuring the same thing?

Is this with Cog or the standard Squeak vm?

Russell


On 22 Dec 2014, at 2:48 pm, Chris Double chris.double at double.co.nz [self-interest] <self-interest at yahoogroups.com> wrote:

> On Mon, Dec 22, 2014 at 4:41 PM, Chris Double <chris.double at double.co.nz> wrote:
> > I don't know what I was doing wrong before but now when I run it I get
> > 640ms for the Self version. That's only 2.5 or so slower than Pharo
> > which isn't too shabby.
> 
> Aha! What was causing the time difference is if I run it in 'time'
> first then I get the slow time. If I run it outside of 'time' first
> then I get the faster time next time I run it within 'time'. Something
> preventing some optimized compilation in 'time'?
> 
> "Self 31" _AddSlots: (| doSomething = ( ^self ). test4 = ( |n <-0| [
> n < 100000000 ] whileTrue: [ doSomething. n: n + 1] ) |)
> shell
> "Self 32" [ test4 ] time.
> 2870
> "Self 33" [ test4 ] time.
> 2898
> "Self 34" test4.
> nil
> "Self 35" [ test4 ] time.
> 635
> 
> -- 
> http://bluishcoder.co.nz
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.selflanguage.org/pipermail/self-interest/attachments/20141222/591d27b1/attachment.html>


More information about the Self-interest mailing list