[vw 7.9] Stripping an Image as fast as possible

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[vw 7.9] Stripping an Image as fast as possible

federico.mennite@lifeware.ch
Hi,
for many reasons I need to be able to perform a partial strip of the
image as fast as possible.
The basic operation is to remove class ClassA and all its subclasses
(around 10000) but unfortunately it takes more than an half hour.

Here's what I do:
1. Remove all sources. This would be necessary only for deployment
purposes but because of a possible bug it is also necessary to gain
performance. Try removeFromSystem:#() with empty arguments an have a
look to the last changes in the changes file to get what I mean.
2. Put everyhing in a modifySystem: block to gain performance.
3. Avoid change propagation to the main changeset (what's the purpose of
this changeset anyway? Can I safely reset it in deployed image?)
4. Remove each class without propagating changes the to current
changeset and changefile (the latter being already ignored because of
step one). Follow a computed "unload" order.

Code snippet:
SourceFileManager default removeAllSources.
SystemUtils modifySystem:[
     XMainChangeSet ignoreChangesWhile:[
         ((SystemUtils sortForLoading: ClassA withAllSubclasses)
reverse) do:[:e | e removeFromSystem:#()]
     ]
]

I've found out 2 significant bottlenecks:
- Behavior>>obsolete : this method is sending
Parcel>>cleanseParcelSystem for each class being removed. Does it make
sense If none of my classes is included in a parcel?
- Class>>localObsolete : a allInstancesDo: is performed for each class
being removed. To any found instance, messages #beMutable and #nilFields
are sent. In my context I can safely assume that no instances are
present so I guess I can comment that part out. What if I had some
instances? Am I right in thinking that the purpose of this part of the
code is to make the GC to behave more efficiently? Wouldn't, in my
context, calling a global garbage collect bypass this last issue?

By modifying the 2 methods above I'm able to remove from the image 10000
classes in 4 seconds. A global GC is confirming significant shrinkage of
memory footprint.

Thanks for you help,
Federico


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc