Hacker News new | ask | show | jobs
by eicossa 2426 days ago
Wait ... let me see if I can anticipate the top comment

"Electron consumes so many resources ... Why so resource hungry ... My workstation already runs Chrome, can't have electron apps bogging it down ... Slack runs on Electron ... VSCode is the only good Electron app ... Why are we doing this ... Dennis Ritchie would be turning in his grave"

This topic could honestly trigger the "parse regex with html" kind of reply.

3 comments

Well, Slack is currently taking almost 3 GB of memory on my machine. Not entirely sure if that's due to Electron or Slack, but I have never found an Electron app that didn't consume vast swathes of memory.

https://imgur.com/GscRFD7.png

If a developer has already decided they care about resource consumption and bloat so little that they're distributing on Electron, then why would you expect them to care about resource efficiency at all?
It is not because of Electron.

An empty Atom window containing 5 source code files consumes about 120MB of RAM. For comparison with native apps, an empty iTerm2 window uses 100MB, and so does an empty Notes.app window. The base memory footprint imposed by Chromium is not that significant.

On my machine, an empty Atom instance is using about 400 MB: https://imgur.com/S1POSPz.jpg
Do you have some packages installed? If so, can you re-run with `atom --safe`?

Granted, it is totally normal to have packages when using Atom, but their memory cost shouldn't be considered a penalty that you pay due to Electron. Rather, it's a penalty that you pay if you want an extensible application in which extensions are allowed to use JavaScript.

I have no custom packages installed - I use atom just to take notes and do small text editing.

When I run `atom --safe` it starts at around the same amount of memory usage: https://imgur.com/j4Co4n6.png

Side note: Running that command is now preventing my from quitting Atom using the Atom > Quit menu entry. I had to force quit it to get it to close.

How much memory does a "hello world" app use?
I tend to get "helpers" that pile up that seem to consume the most.

I developed an application with Electron (+ Vue + Node) for an internal tool used by non-technical staff at my work and I don't have nearly the consumption as some other applications, but there is a lot less occurring on the renderer process than it appears with other applications.

I've added VSCode (with a large project), my application's usage (censored because it's proprietary, but it's a document-based application) and the worst memory offenders on my system (16GB 2015 MBP):

https://imgur.com/a/9rs707J

I've heard of other similar strategies-- but the best one seems to be to offload as much of the work to the main process or talk to a binary wrapped up in the application and do as little lifting with the renderer (the Chromium portion) as possible. My results have been alright so far.

Slack is currently only using 90MB on my machine...
Are you sure you are looking at all running processes? Slack splits it's memory usage across multiple, as you can see from my screenshot.
700MB on my machine. Logged in to 4 active workspaces.
Windows groups them so yes.
I agree, imagine not having a 32gb workstation in 2019.
This is no different than every C thread turning into a Rust evangelism crusade. For me personally it’s interesting because it corroborates the fact that stereotypes do exist, and generalizations can be made about groups of people, to the dismay of people against generalizations.