[self-interest] Re: Simple method send benchmark vs Pharo
mail at russell-allen.com
Mon Dec 22 09:29:24 UTC 2014
Cute benchmark :)
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?
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] ) |)
> "Self 32" [ test4 ] time.
> "Self 33" [ test4 ] time.
> "Self 34" test4.
> "Self 35" [ test4 ] time.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Self-interest