[VM] NCM performance report

Greg & Cindy Gritton gritton at ibm.net
Wed Apr 7 04:12:50 UTC 1999


At 11:08 AM 4/6/99 +0100, you wrote:
>> From: Dan Ingalls [mailto:DanI at wdi.disney.com]
>> Sent: 25 March 1999 06:15
>[...]
>> We have been considering
>> th NCM changes since Tim first got them working.  Simplicity
>> and malleability are certainly positive features.
>> Performance, if it's real, is as well.
>>
>> The main reason I have balked at this change so far is the
>> cost in space for small implementations
>[...]
>> A competing change we have been weighing for a long time is
>> to do away with compact headers.  This would add about the
>> same amount of space (70k) to the mini image, but would yield
>> greater simplifications and speedups in the virtual machine
>> (IMO).
>
>[I know, I'm late as usual.  I've been off-site for a couple of weeks and,
>while I could get at my mailbox, I couldn't mail out]
>
>For interest, I tried bodging the SystemTracer to write out an image with
>3-word headers for every object in the distribution 2.3 image.  It took a
>3.5Mb image to a shade over 5Mb if I made the correct changes --- a large
>penalty on a PDA.  The flip side is that some of us [hi Adrian] trying to
>run multi-user systems on Squeak are willing to pay that space for a large
>speedup if we could get one.  I've had my head in the object allocation and
>GC stuff, so may have a biased view, but it looks like some considerable
>speed could be gained by doing away with the twisty turny maze of tests
>about object formats.  Has anyone done any experiments in this area?  If
>not, it looks like I'll have to do this anyway at some point, as adding an
>optional fourth security word to the header causes all kinds of merry hell
>if you try to keep the existing variable-length headers.
>
>All thoughts welcome!
>
>		- Peter
>
>
>

The increase in size you report seems a little excessive.

Counting the objects in an image stripped down to 2039KB I get
   41939 objects with 1 word headers
    3004 objects with 2 word headers (base + class)
     652 objects with 3 word headers (base + class + size)
   45595 total objects

Converting all headers to 3 words should add 86882 words, or 347528 bytes,
or 17% to the size of the image.  (I am working on converting to 2 word
headers, for an 8% increase in size.  I am not using ImageTracer.)

This is significantly smaller than your 42% increase.
It could be you just have a very different image with lots of small 
objects, or you are doing something wrong, or I am counting wrong.

You can try an experiment that will approximate the size of at
least a 2-word header for your particular image.  Just "uncompact"
all of the compact classes except BlockContext and MethodContext.
(Bad things will happen if you try to "uncompact" BlockContext
or MethodContext.) The following code should do it:

#(CompiledMethod Symbol Array PseudoContext LargePositiveInteger 
Float MethodDictionary Association Point Rectangle String TranslatedMethod 
Color Bitmap) 
    do: [ :className |
        (Smalltalk at: className) becomeUncompact].
  
On my small image, this results in
    43 objects with 1 word headers (only the contexts are left)
 44903 objects with 2 word headers
   652 objects with 3 word headers
 45598 total objects

This gives a final size of 2203KB, the expected 8% increase.
Running the same thing on my 4235KB full Squeak 2.3 image (base image
plus a few extras) results in a final size of 4520KB, for a 6.7% increase.
Since the vast majority of objects are compact, converting to a 3 word
format shouldn't much more than double the additional space of 
converting to a 2 word format.

Greg Gritton
  





More information about the Squeak-dev mailing list