On Mon, Jun 7, 2010 at 2:17 PM, Adrian Lienhard <adi@netstyle.ch> wrote:
Hi all,

Here is the result of some more effort I put into creating small images from PharoCore. Running "ScriptLoader new cleanUpForProduction" in the latest PharoCore 1.1 you get an image that is 6.2 MB on disk. There are two goals for shrinking images: (i) sparing some megabytes makes a big difference if you run a lot of images on a server, also they start up much faster; (ii) modularization: being able to reliably unload packages forces us to cleanly package our code without unnecessary interdependencies.

Note that after running #cleanUpForProduction, you need to close all windows, save the image, restart it, trigger a GC, and save the image again (because for instance the Mac host menu classes will only go away after a restart).


This is excellent news Adrian. It is in my todo list to cleanly remove Mac Host Menu from Core images and load them in Dev. The problem was that they were disable in latest core as they were not working. Now they are working again so I can start what I wanted to do..when I find time. There is a ticket for this if someone is interested to play ;)




BTW, if you have more cleanup code or ideas where we could spare some bytes, let me know :)


I have one that depends in the client's application, but most of the times it is worth:

"To put all all classes with the default category. Still can browse and recompile the whole image.
Most production environments don't care about categories...this make sense when developing."

Smalltalk allClassesAndTraitsDo: [:each | each zapOrganization ].

With that, the image decrease to 5.9 MB.

Cheers

Mariano

___________________
http://www.adrian-lienhard.ch/


_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project