5 ms·
The thing is nobody actually uses hello world programs, by the time you build a real application the difference in RAM usage between that and a good Electron ap
by fabiospampinato 6y ago
The thing is nobody actually uses hello world programs, by the time you build a real application the difference in RAM usage between that and a good Electron app for example blurs significantly.
- inetknght 6y agoI disagree. I remember using lots of GUI apps within a 96MB budget 25 years ago -- even browsers. Electron does not provide that much more desired features than apps from 25 years ago.
- fabiospampinato 6y agoYou can make a very decent Electron app with roughly (roughly = ~2x or less) that amount of RAM too if written well, for that you get pretty much a codebase that you can use everywhere, which on it's own is _massive_.
- ficklepickle 6y agoI've noticed Signal Desktop only uses 100mb. That is quite good for an electron app. A simple server-side node process will use at minimum ~20mb, which obviously does not include a browser. It's open source, I've been meaning to poke around and see what they are doing differently.
- fabiospampinato 6y agoThere's no secret really, just don't import junk dependencies like most people do and spend some time inspecting your memory usage every now and then, with very little effort you'll probably cut down on your memory usage significantly by doing that. With a lot more effort often you can probably even make something faster than uses less memory than a supposedly native app (if they spent less time than you optimizing it).
- tuxychandru 6y agoSignal desktop runs as multiple processes. Did you add up all their memory consumption? On my Debian laptop, Signal processes consume about 700 MB of RSS in total, immediately after starting.
- MaxBarraclough 6y ago> Electron does not provide that much more desired features than apps from 25 years ago. That's true, but advanced GUI features aren't Electron's selling point. It's used because it offers easy portability and the ability to leverage web-dev skills.
- fouric 6y agoWhat does Electron offer in terms of portability that SDL2 doesn't have?
- alvarlagerlof 6y agoThe larger point is ease of use
- fouric 6y agoFine, "What does Electron offer in terms of easy portability that SDL2 doesn't have?"
- opheliate 6y agoAccessibility would be my immediate thought, although I'm not massively experienced in terms of GUI programming, so I could be off the mark here. With something like SDL2, I would have to interface with each operating system's accessibility API directly, in such a way that's not easily portable, unless I bring in a separate library. Even something like GTK has this problem on platforms other than Linux. With Electron, I know that my program will be accessible wherever Chromium's rendering of HTML is accessible, which is a lot more places than anything I'm going to be able to bodge together.
- MaxBarraclough 6y agoSDL is intended for gaming and similar applications, it isn't intended for general purpose GUI development. That's what toolkits like Qt and GTK are for. These toolkits do compete with Electron. With the disclaimer that I don't know a lot about this: Electron has solid support for both desktop and mobile targets. I don't think Qt's mobile support is as good, but I might be mistaken.
- tonyarkles 6y agoLooking at a few things on my machine right now: - Emacs (with 251 open files and IRC running): 100MB - Activity Monitor: 98MB - Word: 227MB - Spotify: 465MB - Slack: 526MB - Thunderbird (not Electron, but a similar weird browser hybrid thing): 663MB - Teams (which appears to be Electron): 747MB I'm not seeing too much of a blur here. The worst chat app (Teams) is using ~7x the RAM of my primary code editor that also is doing chat :).
- fabiospampinato 6y agoWhat some people actually build with Electron doesn't really say much about what people _can_ build with Electron. You can't just compare Emacs with Spotify here, I can't even scroll a list in Spotify without seeing it disappearing on me momentarily, that says more about Spotify's engineers or project managers than it says about Electron. Teams and Slack kind of address the same problem and I'm seeing wildly varying numbers reported by you, without knowing anything about how you are using those apps those numbers are meaningless in my opinion, and if you think they are meaningful then clearly you can achieve different results despite addressing the same use case with the same technology stack. Also there's "chat" and "chat", there's a reason ~nobody uses IRC anymore compared to Slack, they are not the same thing, and it's not just that Slack is easier to use.
- jcelerier 6y ago> What some people actually build with Electron doesn't really say much about what people _can_ build with Electron. no, it does. anyone can build incredible apps on any tech, given infinite budget and time. What matters is how the average app behaves, and for electron it is much worse than the average Qt app for instance.
- fabiospampinato 6y agoThat argument makes no sense to me, do you think you'd change your mind on Electron if access to it were restricted only to very intelligent and motivated people who made very good apps then? The average Qt app would probably be close to the average Electron app if Qt attracted the same kinds of people, i.e. Electron is basically just easier to use and/or the developers picking it think they are getting more value out of it.