Electron.
While I’m singing the praises of Electron apps, I should also praise the memory efficiency of Catalyst apps, especially Apple’s own. 1.5 GB for a single-window app.
@gruber Yeah but have you seen how smooth the News app is? I can resize windows and scroll at over a dozen frames per second.
@gruber To be fair, News might as well be Safari.

@agiletortoise @gruber why isn’t it?

I mean, why isn’t it a PWA, that just runs in Safari?

@gruber Catalyst apps are native apps using native APIs, so whatever News is doing, I don't expect it would use any less with a different technology; it probably has a lot of WebKit going on, to be fair, and whatever you're caching
@stroughtonsmith @gruber fwiw a good comparison would be beeper against WhatsApp — similar use cases but with diff technologies.
@stroughtonsmith @gruber News takes up a massive disk cache on the iPhone
@stroughtonsmith @gruber Also, having empty memory doesn't speed up your computer. It's there to be used. I wouldn't mind if my browser took up the entirety of memory to cache data as long as it drops it when the rest of the computer needs some. Also, the memory column includes memory shared across programs and can appear to be comically large even though real private mem usage is much lower.
@stroughtonsmith @gruber looking at MS Teams WebView Helper (not the app itself) using 1.1gb right now…
@stroughtonsmith I know it's not the nature of Catalyst in and of itself to leak memory, but I think what happens is that apps written primary for iOS can get away with memory leaks because they get paged out in the background when necessary. They're not written to be running non-stop for days (or even weeks).

@gruber @stroughtonsmith They also end up in compressed memory (essentially paged out) or evicted entirely from memory with only a screenshot of the screen remaining (so you see something in the app switcher).

Most apps are written to take that into account, but on macOS, the model is different and an app's state is much more visible than the app switcher: it would be weird if the News app just randomly disappeared from the Dock, for example.

@gruber @stroughtonsmith I think you're mostly right here, except for the use of “paged out in the background”. The actual effect you're looking for would be “terminated in the background”, so that when the app comes back to the front, it's relaunched in a new process—thereby receiving, as we used to joke inside Apple, a fresh set of global variables. Paging back in would give you the old process and memory setup back, leaks and all. Maybe someone on Springboard can come correct me if I'm wrong.

@gruber @stroughtonsmith the tooling issues on iOS make this worse too: you can’t run `leaks` on device like you can on the Mac, so finding leaks is either Instruments (also known flaky) or… you just don’t.

(Irony is it should be easy to find iOS leaks via a catalyst build bc you have the full Mac system accessible! Such an escape valve.)

@gruber @stroughtonsmith Back in the pre-Multitasking days (iPhoneOS 3, manual memory management), a fellow iPhone developer told me he never released any memory because he didn't understand it, and his app would only run for short periods of time 😅
@bondo @stroughtonsmith Does he work at Apple now on Apple News?
@gruber @stroughtonsmith He *does* work at Apple in Cupertino (but not on News :-)
@bondo @gruber @stroughtonsmith what a relief, for a minute there I thought you were talking about me 🤗
@stroughtonsmith @gruber Your point is correct but calling Catalyst apps native is the most weird thing.
@helge @gruber …they are native? Catalyst is native to macOS and has been for six years now; it powers major system apps and system features
@stroughtonsmith @gruber They are certainly not native. Yes a set of builtin apps (like Messages) use that zombie and that is awful.
What system features does it power?

@helge @gruber …how do you personally define native? Because virtually the entire OS is Objective-C/Cocoa, so if you're writing Swift code it's all 'non-native’ 😅 That's a bolt-on runtime with a translation layer and non-native idioms.

If it emits native code, talks to the same system frameworks, and is used to build the system apps, it's ‘native’.

@stroughtonsmith @gruber For me native means that it follows the system UX conventions, UIKit is of course closer to that than say Electron, but it is still quite off. Just like you can easily tell an Electron you can usually tell a Catalyst app (eg via resizing behavior)
What language is being used doesn’t matter that much for me, a PyObjC Cocoa app can be perfectly sound.
An app using a different framework isn’t native 🤷‍♀️
@stroughtonsmith @gruber I acknowledge how much effort goes into making sth like Messages feel like a native app, but imo it would be easier to just make it one 🙃
It’s the prototypical cross platform mistake, massaging it for one foreign platform is actually harder than just doing it proper from the start.
@helge @stroughtonsmith @gruber Would a game written with crossplatform middleware like Unreal Engine or Unity be “native”?
@helge @gruber a bad app is a bad app; I ain't got no problem with window resizing 😛 The simple fact is you likely have no idea you're using Catalyst apps until you come across a bad one, which is the way it should be. Either way, it’s still native, maybe even Apple’s /preferred/ native solution for system apps, considering it’s taken over a good 30–40% of them in just a few years 😉
@gruber The main issue I have with Catalyst apps isn't so much the memory footprint, but that the UX for a lot of them is still pretty bad after a few years, and they often don't feel very at home on the Mac. Looking at you, Home 😡
@gruber It’s all the ads
@gruber and that’s without the news, you add the news and whoa nelley no more room for anything
@gruber I don’t know if it’s Electron app or not but Apple Maps Data is listed as taking up 17 gigs of data even though I’ve deleted the app. By any chance do you know how to get rid of this 17 gigs or why it’s persisting even after the app was fully deleted rather than being offloaded?
@gruber Those memory comparisons are quite off really. There is nothing wrong with apps consuming all the memory available, it’s there, use it.
The key difference is what the memory is being used for, and for Electron that is largely just infra.
@gruber My personal “favorite” is Reminders, which regularly grows to use 11+ GB (yes, a “G”; yes, double digits). I have to remember to quit it every couple of days to release the memory.