compressing the code cache

Mario Wolczko mario.wolczko at
Sat Feb 2 17:53:51 UTC 2002

It's so rare that Jecel makes a factual error that I feel obliged to
correct this message:

Ian wrote:
> > Still, it would be interesting to know if there are any clues
> > that the compiler could write to disk that would help it next
> > time around; that would also improve performance. Can the code
> > cache be compressed in any way?

I implemented the snapshot code in 4.0.   There is an option to pipe
the snapshot through compress.

Jecel replied:
> One source of bloat used to be that every "type"/source method 
> combination that was called got its own native code version, yet often 
> the code was identical for different types. I think this was eliminated 
> from the NIC (I read somewhere that it no longer does "customization") 
> but would guess that it might still be a problem for the SIC. Just 
> passing the code cache through gzip when saving to disk should take 
> care of this, however.

I tried to make the NIC not customize, and got most  of the way there,
however, it   was still too  unreliable to  turn on  by  default.  The
option is called  _ReuseNICMethods.  The only benefit of customization
in the  current NIC is that  accessess to slots  in  self are inlined.
Surprisingly this doesn't buy very much performance  (most of the time
is spent  running SIC code),  but customization costs  a great deal of
memory, especially when running the ui.

If you look at the SIC code, you really do want it to customize,
because this enables a whole bunch of optimization opportunities that
otherwise wouldn't be present (inlnining all sends to self).

> One interesting solution would be to throw out all the code but keep 
> the PICs. They typically take up only 2% of the space of the compiled 
> code. I have no idea what the impact of this "warm compilation" would 
> have on start up performance, but it might be enough to be worth the 
> trouble.

Yes, that's not a bad idea.  Another is to throw out NIC code but keep
SIC code.  Unfortunately the different kinds of code are not
segregated, so this would require a pass through the code cache.


More information about the Self-interest mailing list