[squeakdev] The Inbox: Kernelcmm.1198.mcz
Chris Muller
ma.chris.m at gmail.com
Sun Nov 25 22:54:27 UTC 2018
> That's not the right way to measure things that are so quick, because the
> overhead of block activation is comparable to the runtime of the code
> inside the block.
I get you, but that its so hard to even write such a test indicates
that realworld code also needs to do a lot of blockactivations, and
so this quickly dilutes the density of calls to #class.
The only way I could think was to just cutandpaste the block innards
X 100 times and measure the degradation from the baseline (single):
{ [1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1
xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass.
1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1
xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass.
1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1
xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass.
1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1
xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass.
1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1
xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass.
1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1
xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass.
1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1
xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass.
1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1
xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass.
1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1
xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass. 1 xxxClass.
1 xxxClass. ] bench.
[ 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1
class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class.
1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1
class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class.
1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1
class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class.
1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1
class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class.
1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1
class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class.
1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1
class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class.
1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1 class. 1
class. 1 class. 1 class. ] bench. }
#('2,780,000 per second. 360 nanoseconds per run.' '5,590,000 per
second. 179 nanoseconds per run.')
So X100 more density of calls to #xxxClass degraded the performance
from 27% slower to 50% slower.
So the real question is how dense are the calls to #class, and are
they mostly from only a few senders which could retain the
optimization by #basicClass? It would be an interesting experiment.
Pointless, though, if there's no chance of swaying you.
More information about the Squeakdev
mailing list
