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.
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.
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).
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…
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: