A surprising reduction in built application size?

Hi Everyone,

I spent the whole of yesterday completely rewriting my compiler to use an external instruction library rather than having everything hardcoded in the compiler syntax checker. Doing this allowed me to remove well over 1000 lines of code and about 50 different methods and functions.

The surprising upshot of this is that the built app size has dropped from 26meg to 16.8meg and I’m not sure why. Doing an aggressive build also now only takes about 30 seconds rather than greater than 5 minutes.

I would love to know if anyone has any ideas as to why there is such a massive size reduction and build speed change. Not that I’m complaining I think the change is great, but it confuses me as the methods and functions I removed were tiny with no more than a few lines of code each. I did previously use very large and complex select case statements which I have for the most part replaced with lookup lists.



Is this using the same Xojo version as before?

Hi AlbertoD

Yes 2021r3 API2



one (or more) framework that is no longer used ?

‘Text’ maybe?

Well I went through an old version of my project but I can’t find anything to really account for it. I don’t use any plugins or third party controls.

I suspect that maybe the removal of over a 1000 lines code, the many calls to all those tiny methods and functions and maybe the removal of those horendiously complex select case statements was enough for the Xojo compiler to produce a more compact executable.

Cool anyway…


The previous version had icons that had been dropped in the “Navigation Pane” and the current version loads them dynamically (when the need arises)?


Thanks @Emile_Schwarz for reminding me.

Ah yes! 2021r3 now uses PNG Compression for application icons in projects, so I guess they’re also using compressed icns files in their built applications (like App Wrapper 4, Iconographer Mini and ICNSmini has been doing for a while now).

This can shave at least a mb of each ICNS file!

You’re welcome.

No later than Saturday, I worked on an image using Gimp and this leads to a 3MB png file.

I loaded it with Preview, saved it under a different name and get a 300MB png file…

1 Like

As a test I built an old version of the app before I made the changes as well as the new version. Both using aggressive optimisation, I examined the package contents of each and the only difference was the size of the compiled application all the resources and frameworks were identical. Both were built in 2021r3 and have been upgraded to API2.

I’m not sure what is going on with PNG compression but all the images included in the package were exactly the same size as the images in my project directory. I guess they are already as compressed as much as they can be…

Oh then maybe I am mistaken.

Maybe not, I’m using PixelMator to create my icons and according to it’s help file it saves compressed PNGs…

I’ve just noticed that some of the compressed PNGs in the application package are actually larger than my original source icons.


Xojo Compressed in package:

Were the originals JPEG?

No all PNGs…


I can confirm the bug. Most of my already compressed PNGs are now larger in the app. Screenshot shows the resources folder in the upper part and the original files in the lower part:

@Trig_Charters1 : do you want to do the Feedback case?

Are they stored in the same HD (or SSD) ?

Logical file size are not a reference (it shows the number of used HD/SSD blocks to store the file, not the real, physical size).

Sure I’ll give it a go, I’ve never done one before… :slight_smile:

All stored on the same HD which is a fusion drive formatted with APFS, 10.15.7 Catalina.


That implies Xojo re-encodes image files, which is odd.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.