realbasic-nug
[Top] [All Lists]

Re: Tips Shrinking App Size

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Tips Shrinking App Size
From: Ben Blake <bens_software@benandruby.com>
Date: Sat, 31 Jan 2009 20:54:16 +1100
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com; dkim=neutral (body hash did not verify) header.i=@gmail.com
Delivered-to: listarchive@realsoftware.com
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=p+cpxHta9l6nXun25M0cCgfN6hUBXeds+otPKwbQxQ0=; b=KarhTNqkNJa9w79VmwTlYKvHp3+gPkeVr2cBwcI4EQmXWH/ZYRwy29tyrE3LvzHHvU uHXBc7763037yvJSNqFUXVLqFQB8DdSy0CMI/sDnL5aNf5xHyD/S7T8wIIxlbbo6n6Oe 3Apzo2hzEtT2X9vEq3iubCh7JBmf6jYIYdqo8=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=JJk5NHjIWzkjh4+mc1elujSlVYXQw8ngT6YvemI+fTITyj51FfyVmJtpSOKfLCiKbA e9ZGRm4amh7eeTk6R7FNZ6HfNmRygsfR7NxdOcSmiHytpNrfLer5SYIoApQk49vdFNvb 42kYthknHV6n69PDJHcsdiWqwW+7MBvDMMwvk=
In-reply-to: <35739C2F-BE94-4D61-917E-FAE5827B92BB@xochi.com>
References: <35739C2F-BE94-4D61-917E-FAE5827B92BB@xochi.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
G'Day!

I don't know why the app sizes have gone up, but I just compiled my application with both 2007r5 and 2008r5.1 and there was a 3 MB increase the MacOS app. Compare this to there was only a 300K increase in the the RBframework (which I normally expect with the addition of new features). I was not expecting such a large change just from my code!

Does anyone know what caused this increase?

cya
Ben

On 31/01/2009, at 4:18 , Michael Diehr wrote:

I just completed the first steps of updating my app (which formerly was written in REALbasic 4.5) to compile 2008R5.1. I expected the file size to increase a bit, but was surprised by how large it is now. To be fair, the updated version of my app has more features, so part of the size increase is expected, but still...

            RB2008     RB4.5
Mac Intel : 15.3MB
Mac PPC   : 15.7MB     4.4MB
Mac UB    : 28.2MB
Win32     : 14.9MB     3.1MB

About a 4x increase for a single platform, and nearly a 7x increase to make a universal binary.

Poking around in the package contents for the Intel version, I find:

Frameworks              2900K
        MBS  2100K
        RB    800K
MacOS                   9500K
        App  6800K
        RB   2700K

Resources               2900K
        ICNS 1900K
        art  1000K
        
Total                   15300K


A few things stand out --

* ICNS: any filetype defined with an icon seems to include a full ICNS icon file, which typically is 104K. I had 18 of these which are not needed and can be stripped. Savings: 1800K

* Art: some of my art is using TIFFs instead of PNGs or JPGs. Savings: 1000K

* Frameworks: MonkeyBreadSoftware (MBS) plugins. Some of these are quite large (e.g. the TIFF plugin is > 500K). I can probably reduce the # of these by carefully trimming code & features and using using declares instead of plugins in a few cases. Savings: perhaps 800K ?

* Frameworks: REALBasic: RBXML.rbx_0.dylib is 560K and I believe is related to my use of the XMLDocument class. Not sure if I can strip this.


So, with some judicious trimming, I think I can reduce my 15MB app down to about 12MB. Better, but still a nearly 3x increase from before.

The good news is that the app compresses quite well: From 12MB down to about 3MB. The old RB4.5 app only compressed from 4.4MB down to 1.4MB.

So, on the one hand, my app has grown 4x in size. On the other hand, zipped, it's only grown by 1.6MB. The reason I care so much about file size is that this app gets included in a media build and then gets downloaded 100s or 1000s of times.

Any ideas on ways to further compact the app?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>