Comment by sfn42
9 hours ago
Yeah people love to shit on electron and such but they're full of crap. It doesn't matter one bit for anything more powerful than a raspberry pi. Probably not even there. "Oh boo hoo chrome uses 2 gigs of ram" so what you have 16+ it doesn't matter. I swear people have some weird idea that the ideal world is one where 98% of their ram just sits unused, like the whole point of ram is to use it but whenever an application does use it people whine about it. And it's not even like "this makes my pc slow" it's literally just "hurr durr ram usage is x" okay but is there an actual problem? Crickets.
I have no issues with browsers specifically having to use a bunch of resources. They are complicated as fuck software, basically it's own operating system. Same for video games or programs that do heavy data processing.
The issue is with applications that have no business being entitled to large amount of resources. A chat app is a program that runs in the background most of the time and is used to sporadic communication. Same for music players etc. We had these sorts of things since the 90's, where high end consumer PCs hat 16mb RAM.
"chrome uses 2gb of ram"
these days individual _tabs_ are using multiple gb of ram.
Don't know about chrome, but Firefox has an about:memory special page that will let you know which tabs are using the most ram. Of all the sites I use, youtube is the only culprit. When I am done watching a video, I use the about:memory to kill the associated process (doesn't destroy the tab (in case I want to come back to it)). I assume it is all the javascript cruft.
The issue isn't usage, it's waste. Every byte of RAM that's used unnecessarily because of bloated software frameworks used by lazy devs (devs who make the same arguments you're making) is a byte that can't be used by the software that actually needs it, like video editing, data processing, 3D work, CAD, etc. It's incredibly short sighted to think that any consumer application runs in a vacuum with all system resources available to it. This mindset of "but consumers have so much RAM these days" just leads to worse and worse software design instead of programmers actually learning how to do things well. That's not a good direction and it saddens me that making software that minimizes its system footprint has become a niche instead of the mainstream.
tl;dr, no one is looking for their RAM to stay idle. They're looking for their RAM to be available.
I dunno man, I have 32gb and I'm totally fine playing games with 50 browser tabs open along with discord and Spotify and a bunch of other crap.
In not trying to excuse crappy developers making crappy slow ad wasteful apps, I just don't think electron itself is the problem. Nor do I think it's a particularly big deal if an app uses some memory.
You're right, Electron is not inherently bad and apps need RAM. There's no getting around that.
The issue with Electron is that it encourages building desktop apps as self-contained websites. Sure, that makes it easier to distribute apps across systems and OSes, but it also means you've got front end web devs building system applications. Naturally, they'll use what they're used to: usually React, which exacerbates the problem. Plus it means that each app is running a new instance of a web browser, which adds overhead.
In real life, yeah, it's rare that I actually encounter a system slowdown because yet another app is running on Electron. I just think that it's bad practice to assume that all users can spare the memory.
I'll admit that my concern is more of a moral one than a practical one. I build software for a living and I think that optimizing resource usage is one way to show respect to my users (be they consumers, ops people running the infra, or whatever). Not to mention that lean, snappy apps make for a better user experience.
Lazy developers can make bad apps that waste RAM no matter what framework. But even conscientious developers cannot make an app with Electron that compares favorably to a native app. Electron is inherently a problem, even if it isn't the only one.
The problem with having 32gb of RAM is that there is no mechanism to power off part of it when it is unneeded (plus RAM constitutes a significant fraction of a device's total power consumption) so if the device is running off a battery and is designed to keep device weight to a minimum (e.g., battery as small as practical), then battery life is not as good as it would be if the device had only 16gb.
This is why the top model of the previous generation of the iPhone (the iPhone 16 Pro Max) has only 8 GB of RAM, bumped to 12 GB for the current top model (the iPhone 17 Pro Max at the higher tiers of additional storage). If Apple had decided to put more RAM than that into any iPhone, even the models where the price is irrelevant to most buyers, they would not have been serving their customers well.
So, now you have to pay a penalty in either battery life or device weight for the duration of your ownership of any device designed for maximum mobility if you ever want to having a good experience when running Electron apps on the device.
The web browser on my phone instantly gets killed the moment I switch to another app because it eats up so much ram.
I think it's a correlation vs causation type thing. Many Electron apps are extremely, painfully, slow. Teams is pretty much the poster child for this, but even spotify sometimes finds a way to lag, when it's just a freaking list of text.
Are they slow because they're Electron? No idea. But you can't deny that most Electron apps are sluggish for no clear reason. At least if they were pegging a CPU, you'd figure your box is slow. But that's not even what happens. Maybe they would've been sluggish even using native frameworks. Teams seems to do 1M network round-trips on each action, so even if it was perfectly optimized assembly for my specific CPU it would probably make no difference.
Nearly all apps are sluggish for a very clear reason - the average dev is ass. It's possible to make fast apps using electron, just like it's possible to make fast apps using anything else. People complain about react too, react is fast as fuck. I can make react apps snappy as hell. It's just crappy devs.
Yea, these applications are typically not slow just because the use Electron (although it's often a contributor). But the underlying reason why they are slow is the same reason why they are using Electron: developer skill.
The people I trust to give good security recommendations (e.g., the leader of the Secureblue project) tell me I should completely avoid Electron (at least on Linux) because of how insecure it is. E.g., the typical Electron app pulls in many NPM packages, for which Electron does zero sandboxing.