Adding a new imediate type

Bryce Kampjes bryce at kampjes.demon.co.uk
Thu Jan 5 23:31:34 UTC 2006


Bert Freudenberg writes:

 > > John McIntosh measured it, I haven't yet profiled the VM
 > > seriously. I've noticed that opening a large Morphic explorer seems to
 > > be spending 50% of it's time creating points, this is my
 > > interpretation of a Squeak profile.
 > 
 > But Points *do* have a special primitive! Number 18?

True but it still calls

  instantiateSmallClass:sizeInBytes:fill:.

All it needs to do, is grab some memory then populate it. That's a
fairly short sequence, so long as a GC isn't necessary. The speed gain
will be from specialising the entire primitive for the case where a GC
isn't needed. It's more code, and more special cases, but still
probably easier than creating new intermediates.

My interest is optimising compiled code with an inlined
primitive. There I'm hoping that allocation should take about 10-20
clocks if a GC isn't needed. For a handful of critical types, a
similar optimisation may pay off for the interpreter.

I haven't properly profiled the VM while running these benchmarks.
I don't know how much time is being spent in primitive dispatching.

Bryce



More information about the Squeak-dev mailing list