Le 20/02/2015 15:41, Marcus Denker a écrit :
Hi,

The current Pharo4 contains *a lot* of MCVersionInfo instances.

MCVersionInfo allInstances size

11095

The hold on to strings, Date, UUID… a lot of stuff. All in all, this is around 
10% of the current
image.

If you do

MCVersionInfo allInstances do: [ :each | each instVarNamed: 'ancestors' put: 
nil ].

you image is a couple of MB smaller.

In the past, when this information started to be >8MB, we did that. With the 
bad effect
that we can not merge anymore across this boundary: we kill the past.

You can still merge across that boundary, but you need to do it in git, not in Monticello.

Now this information is of course continained in the last MCZ file, too (all of 
them contain
the complete history…)

So would the following work?

-> we set the “ancestors” of MCVersionInfo to #reload
-> the accessor, when it sees #reload, takes the name, deduces from that the 
package,
      and goes to the repo to load the ancestry info from the MCZFile.

This means that e.g when saving a MCZFile, it would first re-create history 
info and then save
it completely (like now), yet someone who just uses the system would never need 
to have this
info in the image.

Yes, this could work. But I'll probably try a subclass of MCVersionInfo with a kind of lazy loading of the ancestry chain (in a weak array so that it gets eaten away if not used). And the weak array would ensure that you don't overuse memory without having to use become:

Like that, on git, I could be faster and not write the whole ancestry at all.

I just did something a bit reverse with MCDependencyVersion for GitFileTree: I added a MCResolvedDependencyVersion and it worked.

Up to you.

Thierry

Reply via email to