330
Software is slow because of bad design, not slow languages
(www.seangoedecke.com)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
I once did some testing comparing very simple apps built with Tauri (using system webview) and native library and the difference in memory usage was not that big. I'm looking now at a simple PDF viewer in GTK and it's using 120MB. My app written in Tauri is using 150MB. In theory native apps will use less memory when you run a lot of them at the same time but if you check the size of native Linux app they are not that tiny. They still will easily use hundredths of MB of RAM. Simple, native todo app will easily use 150MB. Yes, badly written electron app will use way more than that but you have webview tools that are really good and not that heavy.
I've done tests like that too, and I can't agree with you.
Plus, GTK is a bad comparison. One of the worst native toolkits, if not the worst one along with any and all immediate mode ones.
I've also compared native Rust library (egui? don't remember exactly) with Tauri and the difference wasn't that big. What did you compare? As I said, native solutions should use less memory if you run a lot of them at the same time as they will load shared libraries only once. So I guess if you run KDE and start single Qt app it will look better than running single Qt app under Awesome WM or cosmos.
I compared one single Qt app (QOwnNotes) with one single similar Tauri app (I don't remember the name, I was trying apps because I was looking for something extensible that wasn't Electron-based as Logseq). It was a huge difference for me, at least, more or less 100 MB, and for what I knew, it was not that badly programmed.
And for me, with only 16 GB lf RAM and an Intel Xeon v4 (12C/24T @ 2.20 GHz max) it's even more noticeable, specially because I work in multimedia (music production and sound design) and I have to use a browser and a communications app all the time because I need to research stuff and communicate with some peers and my clients (the very few times I have clients).
Every byte counts, even if you have lots of memory and a huge processor and GPU. Thinking that "1 MB is not that much" is what has led us to this crysis. We should make any and all possible optimizations to be able to ship featureful software that's not overbloated (Suckless dickheads can suck my ass).
Had the same experience when I was testing zed. Was thinking it would be a lot better since it's written in rust but there wasn't any difference in memory/CPU usage between it and VSCodium, which is electron app.
Even nvim will eat up about 5GB of RAM when used as an IDE. MCP alone will use that much of RAM independent of the editor.
From what I remember, Vscode has quite a fair bit of native code in various areas to make it perform better. So it may not be the representative Electron app for comparison.
Electron is also the worst web based toolkit out there. Solutions that use system webviews instead of running whole Chrome are much lighter.
That would be 20 kB, 30 kB, 40 kB, I don't think you meant that.