[squeak-dev] Re: Instance variable access in superclasses.

Matthew Fulmer tapplek at gmail.com
Wed Nov 26 04:49:57 UTC 2008


On Tue, Nov 25, 2008 at 03:45:09PM -0800, Andreas Raab wrote:
> Matthew Fulmer wrote:
> > On Wed, Nov 26, 2008 at 12:13:14AM +0200, Igor Stasenko wrote:
> >> IMO, it is better to recompile things all the way down, rather than
> >> bother with such complexity which gives no real benefits except
> >> compiling time.
> > 
> > Or switch to SystemEditor, which can recompile classes 6-8x
> > faster than ClassBuilder.
> 
> Really? I'm somewhat surprised to hear that. It means that either most 
> of the time in recompilation doesn't go where I think it goes or that 
> SystemEditor does things very differently from ClassBuilder. Either way 
> I always take a 6x-8x speedup when I can get one - where do I find 
> SystemEditor to run a few benchmarks against it?

Most of the time recompiling a class is not in the compiler. It
is in the three full image scans necessary to swap all object
instances. All three are within ClassBuilder >> update:to:

1. allInstances in ClassDescription >> updateInstancesFrom:
2. elementsExchangeIdentityWith: in ClassDescription >>
   updateInstancesFrom:to:isMeta:
3. becomeForward: or elementsForwardIdentityTo: in
   ClassBuilder >> update:to:

ClassBuilder thus does 3n full memory scans (where n is the
number of classes to recompile)

SystemEditor does n + 2 full memory scans. It does the
allInstances search once per class, then groups all the becomes
into two becomes at the end of the commit (which is most of the
reason why SystemEditor is truly atomic). I've tried to collapse
the n allInstance scans into one, but have been unable so far to
do it without crashing the VM. I think one should be able to
compile any number of classes with just two memory scans (one to
find all instances, one to becomeForward: them)

The best way to benchmark SystemEditor is to get Monticello 1.6,
which is already hooked up to use SystemEditor for all its
loading needs. Run the following to get MC1.6:

HttpSocket httpFileIn: 'installer.pbwiki.org/f/mc15.st'.
Installer install: 'Monticello16-Beta'

Beware: SystemEditor cannot yet handle packages with Traits or
packages that have Tweak classes. I'm working on it.

For some more info on SystemEditor, see
http://installer.pbwiki.org/SystemEditor
http://installer.pbwiki.org/Monticello16-Beta

I havn't put any SystemEditor speed data on the wiki yet.
They'll be more documentation as I push to get Monticello 1.6
into a final release, which should be in about two months

-- 
Matthew Fulmer -- http://mtfulmer.wordpress.com/



More information about the Squeak-dev mailing list