I’ve been using some of Bruno’s code in my SwiftUI apps, I didn’t even realize he worked for Spotify.
But this talk is something that clicks with me, I mean after all who wants to download a 40 MB app to reset permissions, when a 4 MB app can do it, and a better job at it?
That’s fucking insane. After watching that video, Spotify found their downloads go down, the bigger the app, which is why they’ve dedicated a whole team to keeping the App Size minimal!
On macOS i just updated Spotify and it goes up from 274 MByte to 311 MByte. And only for Apple Chips. So some work to do i guess? Or benefits are Windows only?
I actually been thinking about making graph with Xojo hello world App sizes, throughout many versions of Xojo. (Since yes its like at some point they just stopped caring about it and just add more and more to gigantic libraries that dont get dead stripped in any way like compiled code would do).
And on the Graph I would then put Hello World C# Application on macOS (stand alone with no external dependencies which is 7 to 8 mb) and maybe others could supply similar stats for other things, like standalone Electron App on macOS (or some specified platform)…etc etc
Here is example of App with one Window and one Button that posts MessageBox(“Hello World”)
Applications nearly doubled in size between 2021r1 and 2023r3
Why ?
They should obviously be held accountable for things like this.
A simple “Hello World” Mac application, with one window, and one button that shows an alert dialog in SwiftUI, is 178,773 bytes for a Universal Binary.
Here’s the code, so you can test it yourself in Xcode.
I just tried the option in Xcode for this with the code I posted above and it made no difference in file size. I guess there’s not enough code to make any difference. Shame.
The problem is the fundamental design of the framework, like Christian pointed out. The framework includes everything, even if you don’t use it.
Yet, the framework is totally not needed. They could (and probably should) do everything with native Xojo and declares, and strip the junk that’s not needed. I realize that would increase compile time, and it would be a monumental job, which as you can see TOF, the Xojo faithful don’t even believe it’s needed (it seems some of them don’t have the experience that you or I do).
At this point, I honestly don’t seem 'em doing anything about it either.
One of the points Bruno raised was code signature size, I have checked this with my two apps to see if there is any difference.
He does say to use Asset Catalogues as much as possible (which Xojo doesn’t support). I hate Asset Catalogues, for their closed nature, but knowing that they help improve the speed of my app, makes me hate 'em less.
SwiftUI version 24,816 bytes with 183+7 hashes (per architecture)
Xojo version 108,416 bytes with 1,708+7 hashes (per architecture)
Because the framework bloated up as it has Listbox & DesktopListbox - two completely separate entities. And so many others are duplicated
NO - they CANT strip this - its a DYLIB
Not build process I know of steps out unused stuff from a dylib (since you’d have to rip it apart & reassemble it into a dylib)
What I CAN say is this is in effect a result of getting rid of the Xojo framework which WAS designed to be stripped and much more modular and reverting to the everything is global all the time style of framework
The latest Beta of PureBasic now includes a WebView that makes it very easy to expose PureBasic functions to JS. I have used it to create an alternative runtime to Electron which has File System, Database, Cipher, QR Code creation, PDF creation, Zip and CGI built in and it weighs in at just 2.5MB ( that’s on Linux - I haven’t tried compiling for other platforms yet but I guess the executable size will be fairly similar ).
As an example database access looks like this:
let db = null;
try {
db = r4.database();
db.handle = await db.connect('sqlite', 'iptv.sqlite3');
db.tx = await db.execute('begin');
await db.execute('update categories set description = ? where category_id = ?', ['Sport', 'sport']);
let pm = [['Cartoons', 'animation'], ['Munchkins', 'kids']];
await db.executeMany('update categories set description = ? where category_id = ?', pm);
db.tx = ! await db.execute('commit');
let rs = await db.select('select * from categories order by category_id');
console.log(rs); // { records: [ [], ..], fields [ { 'name': 'category_id', 'type': ...}, ...] }
await db.close();
} catch(err) {
if(db != null && db.tx) { await db.execute('rollback'); }
console.error(err);
}
I’ve made deployment really easy too, the executable just needs to be side-by-side with index.html ( alternatively you can pass the first page of your app as a command line parameter ). Any CGIs go in a cgi-bin subfolder.