News for hackers. Stuff that matters.
Re:Electron 2.0.0 beta by h1d on Thursday February 22, 2018 @06:12AM (#16436783)
How bad is it to run Electron apps on Linux?
Re:Electron 2.0.0 beta by pizzapill on Thursday February 22, 2018 @06:19AM (#16436815)
Slack uses ~ 2 GB of Ram and ~ 10% CPU when idle. I used it for a short while but now I'm just leaving a Slack tab open in my browser. Its exactly the same functionality-wise.

Basically I'm fine with Electron apps but I have yet to find one that I need and can't be replaced by a browser tab.

Re:Electron 2.0.0 beta by danielbarla on Thursday February 22, 2018 @06:52AM (#16436933)
Comments like this make me wonder what's going on exactly. Surely your browser tab should now be using ~2GB of Ram and ~10% CPU, since it's the browser, HTML and JS part of Electron that's causing all that?

To be honest though, since my VS Code instance is sitting at ~500 MB (all processes together) and 0%, I'd wager it's not actually Electron itself that's at fault. It probably is incredibly inefficient compared to pure native code, and probably makes it easy to write inefficient code, but still, that's quite heavy usage you're referring to.

Re:Electron 2.0.0 beta by pizzapill on Thursday February 22, 2018 @07:22AM (#16437036)
My guess is that a lot of memory in the browser is shared.

Another commentor in this thread wrote that VS Code is incredible efficient for a Electron app.

Re:Electron 2.0.0 beta by danielbarla on Thursday February 22, 2018 @08:16AM (#16437313)
That could certainly account for some of the memory usage. I'm still confused about why there would be a 10% cpu usage on one, and not on the browser version (especially if they are equivalent, or even share underlying code).

VS Code certainly is efficient for an Electron app, and I'm sure it's really hard to achieve that level of efficiency. To be honest though, I use it side by side with Visual Studio itself, and on many metrics, it eats its big brother for breakfast (e.g. [1])... and that is a native app. One can argue that it's apples and oranges, and that the two are not equivalent, but we have an interesting counterpoint. While I'm sure performance is heavily weighted in favour of native, it seems like it's certainly surmountable.

[1] https://twitter.com/id_aa_carmack/status/695013979807047680?...

Re:Electron 2.0.0 beta by zlynx on Monday February 26, 2018 @12:34AM (#16463348)
My theory on Slack's ridiculous CPU use is animated graphics. If some of those are on the screen the CPU use is at least 10%.
Re:Electron 2.0.0 beta by jrs95 on Thursday February 22, 2018 @11:49AM (#16438942)
My theory is that their code is shit. It shouldn't be surprising given that their Chief Architect wrote a Medium post (Oct 2016) in which he cited concurrency as one of the primary benefits of PHP, and advocated for "curl'ing to localhost" to achieve parallelism.
Re:Electron 2.0.0 beta by calcifer on Thursday February 22, 2018 @06:57AM (#16436946)
On my laptop running Slack Linux 3.0.5 with 3 workspaces & several dozen channels, it idles at 0% CPU and ~550MB RAM (see screenshot [1]).

[1] https://i.imgur.com/juQbGW7.png

Re:Electron 2.0.0 beta by oselhn on Thursday February 22, 2018 @07:27AM (#16437060)
Comparing it to similar native app like pidgin it is still about 10 times more.
Re:Electron 2.0.0 beta by calcifer on Thursday February 22, 2018 @10:47AM (#16438325)
With 10 times the features, it’s not at all unreasonable.
Re:Electron 2.0.0 beta by laurent123456 on Thursday February 22, 2018 @07:43AM (#16437151)
That's also roughly what I see on Windows for my Electron app [0]. 0% idle CPU and about 200MB of RAM. That's large but acceptable compared with other non-Electron apps running, like Sublime Text (170MB) or Thunderbird (320 MB).

[0] https://imgur.com/tMhEwtp.png

Re:Electron 2.0.0 beta by piracykills on Thursday February 22, 2018 @09:09AM (#16437596)
You have some choice native apps - Sublime is Python, which is rather horrible with memory usage and Thunderbird essentially embeds a browser just like Electron apps.

Compare VSCode or Atom with Emacs or Gvim for something more native.

To pick some apps off my desktop right now:

- Emacs with a pile of extensions, 22 MB

- SpeedCrunch, 13 MB

- SumatraPDF, 19 MB

- MS Word, 101 MB

Re:Electron 2.0.0 beta by vopi on Thursday February 22, 2018 @02:11PM (#16440440)
Uhh sublime is written in C++ with it's own custom UI the toolkit iirc. It only uses python for scripting.
Re:Electron 2.0.0 beta by laurent123456 on Thursday February 22, 2018 @09:28AM (#16437710)
In my list of applications that are always active, Firefox and ConEmu are also over 500MB too. The exception is Total Commander (amazingly, still compatible with Windows 3.1), which is only 20MB but it's more the exception than the rule.
Re:Electron 2.0.0 beta by pizzapill on Thursday February 22, 2018 @07:21AM (#16437028)
Haven't been using it since ~ 2 years. My data might be out of date.