Can you imagine if XDC had talks like one?

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?

1 Like

Xojo keeps making the same mistakes over and over again.

Android apps made in xojo are stupid big. An empty app is like 40Mb vs 40Kb in B4A

2 Likes

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!

1 Like

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 bet you their macOS is Electron and not a native app.

3 Likes

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”)

image

Applications nearly doubled in size between 2021r1 and 2023r3

Why ?

They should obviously be held accountable for things like this.

4 Likes

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.

struct ContentView: View {
    @State var showAlert: Bool = false
    
    var body: some View {
        VStack {
            Button( "Hello World" ) { showAlert.toggle() }
        }
        .padding()
        .alert( "Hello World", isPresented: $showAlert ) {
            Button( "Done", role: .cancel ) { }
        } message: {
            Text( "This is an alert" )
        }
    }
}
2 Likes

Did 2021r1 have the stupid DesktopControls?

I just checked and it does not.

So yea the stupid DesktopControls probably cost us users doubled app sizes.

2 Likes

PureBasic hello world app - 128744 bytes with debugger turned off and optimize turned on.

If OpenWindow(0, 100, 100, 300, 200, "Hello World", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ButtonGadget(0, 100, 50, 100, 30, "Click me")
    
    Repeat
        Event = WaitWindowEvent()
        If Event = #PB_Event_Gadget
            If EventGadget() = 0
                MessageRequester("Hello", "Hello, world!")
            EndIf
        EndIf
    Until Event = #PB_Event_CloseWindow
EndIf
1 Like

This is in contrast to apps that have been compiled with Xcode got smaller with the introduction of Sonoma and also have a smaller memory footprint.

I forgot to enable that, I only recently found out that there is an option in Xcode to optimize for size. Maybe I’ll try it later.

Really? Wow… I compiled this in Xcode 15.2 on Ventura, if it can get even smaller, I’m blown away.

I’d love to know what @DaveS can do with Swift/AppKit, I’m suspecting a smaller app than SwiftUI.

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.

1 Like

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

1 Like

Man, I’m a fecking idiot, I got into the debate with those who’re dismissing Xojo’s bloated app sizes as being a problem.

Then it dawned on me, not my problem anymore… Stupid.

3 Likes

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.

1 Like

I turned it off in Purebasic, no difference so not sure what its even doing. Or maybe the code was so small there wasn’t anything to optimiize.