Playing with Exupery
Göran Krampe
goran at krampe.se
Fri Feb 16 14:20:30 UTC 2007
Hi folks!
Just stumbled on this little tiny benchmark:
http://butunclebob.com/ArticleS.UncleBob.SpeedOfJavaCppRuby
As you can see Squeak is referenced a bit down in the comments with code:
"Java is the winner, for 2100000 it spends 250 msec on average. Ruby 6500
msec on average. Squeak Smalltalk 2269 msec, VisualWorks Smalltalk 460
msec."
I threw the same code into my Gjallar 3.8 image using the Exupery VM for
Win32 and cobbled together this (excluding the actual #runOn: methods):
----------
bench
"self bench"
Transcript show: 'Normal:', ([self runOn: 2100000 ] timeToRun) asString;cr.
Exupery initialiseExupery.
ExuperyProfiler optimise:[self runOnX: 2100000].
Transcript show: 'ExuperyOptimised:', ([self runOnX: 2100000 ] timeToRun)
asString;cr.
Exupery dynamicallyInline.
Transcript show: 'ExuperyOptimisedInlined:', ([self runOnX: 2100000 ]
timeToRun) asString;cr.
------------------------
Which gave this (three runs):
Normal:2698
ExuperyOptimised:5217
ExuperyOptimisedInlined:1807
Normal:2666
ExuperyOptimised:5030
ExuperyOptimisedInlined:1812
Normal:2672
ExuperyOptimised:5182
ExuperyOptimisedInlined:1770
Note: #runOnX: is exactly the same as #runOn:, I just didn't want to get
Exupery mixed up with "normal" code.
So.... well, evidently Exupery manages to do some inlining here :) and the
end result is roughly 32% faster than interpreted. I did look at the
exupery.log file but couldn't make much out of it.
I also played around a little bit with the constants in #optimise but that
only made things *worse* - possibly it decided to compile more and then
didn't manage to inline? Have no idea. :)
regards, Göran
PS. This was using Exupery 0.10 - I see there is a 0.11 on SM... Darn! :)
More information about the Squeak-dev
mailing list
|