News for hackers. Stuff that matters.
Re:Electron 2.0.0 beta by dvfjsdhgfv on Thursday February 22, 2018 @02:32AM (#16435874)
It's really sad that in spite of the main glaring problem of Electron apps they didn't as much as even mention any work done on performance optimization in 2.0.0. The changes mentioned are just make up when compared to the real problem.
Re:Electron 2.0.0 beta by bengotow on Thursday February 22, 2018 @02:48AM (#16435956)
Electron’s performance is fairly tied to Chromium’s - the Electron changelog references a Chromium version bump and you’ll need to look there for perf improvements (which isn’t ideal - I wish they’d pulled in some highlights!)

To be honest, people using Electron are doing it because of huge business / process wins and worse performance is a generally acceptable downside. Performance is improving as Chromium improves, but it isn’t a huge focus in the Electron community.

Re:Electron 2.0.0 beta by b123400 on Thursday February 22, 2018 @05:42AM (#16436670)
I see it the other way round. The people and community who chose electron at this point probably don't care about performance as much as we do. Improving performance would probably make us (people who care about performance, capable of writing lower level code) happy, but that's not their target user. Their community are people who write web apps, who don't want to learn native but want to make something.
Re:Electron 2.0.0 beta by realharo on Thursday February 22, 2018 @02:43AM (#16435931)
Is there anything they could even do in that area? (other than improving Chromium itself)
Re:Electron 2.0.0 beta by make3 on Thursday February 22, 2018 @02:37AM (#16435896)
this looks likes an internal dev oriented page, not a public announcement type of deal.
Re:Electron 2.0.0 beta by nukeop on Thursday February 22, 2018 @03:06AM (#16436031)
What do you find lacking in Electron's performance? Compared to all competing UI frameworks it isn't really any different, except it allows for faster and easier development and deployment.
Re:Electron 2.0.0 beta by adolfojp on Thursday February 22, 2018 @04:42AM (#16436422)
It wastes tons of memory.
Re:Electron 2.0.0 beta by nukeop on Thursday February 22, 2018 @04:44AM (#16436433)
I don't think 100-150MB is a "ton",and I don't think it's "wasted". It's actually as much as a single tab of a browser. If it takes much more, it's not Electron's fault, it's the program's developer's - memory leaks are not uncommon in javascript SPAs.
Re:Electron 2.0.0 beta by dvfjsdhgfv on Thursday February 22, 2018 @05:02AM (#16436514)
First of all, it's not 100-150. If it stopped at that, nobody would even care to mention this huge problem. What you get in real life is something like 800 MB for memory alone, and CPU usage can be similarly high. There are legitimate reasons to use that much resources, just not by the GUI.

Really, it's as if all this fundamental computer science, O(n), finding the shortest path, all these efforts in optimization that we do at universities - as if all this just went down the drain and the moment you leave the CS department you say, "Ah, screw all this, I'll just allocate all I can, just in case". This is just so wasteful and it really makes me sad that so few people care.

Re:Electron 2.0.0 beta by SquareWheel on Thursday February 22, 2018 @06:13AM (#16436790)
I just launched Discord, the heaviest Electron app I have installed, and it idles at 135 MB of memory. I'm not seeing anything close to 800 MB being used.
Re:Electron 2.0.0 beta by matwood on Thursday February 22, 2018 @07:19AM (#16437022)
Make sure to add all of the helper processes together. Slack plus all of its helpers is currently using 1.2GB of RAM on my MBP. Each Slack group I'm a part of adds 300-500MB to that total.
Re:Electron 2.0.0 beta by SquareWheel on Thursday February 22, 2018 @08:38AM (#16437419)
The 135 MB was the total of all sub-processes.

https://i.imgur.com/1ZEffk6.png

Re:Electron 2.0.0 beta by dictum on Thursday February 22, 2018 @05:08AM (#16436542)
It's more that all the optimizations and strategies which apply to a browser built to hold many open tabs at once, support many standards and protocols and quirks etc. must be loaded into memory for a simple application that is not a browser.

You get all the tradeoffs of Chrome (e.g. cache everything you come by) outside of Chrome proper.

Re:Electron 2.0.0 beta by nukeop on Thursday February 22, 2018 @05:31AM (#16436624)
A browser (or Electron) does not allocate as much memory as it can on a whim, every byte of that memory is used to bring you features, caching, and so on. What program have you seen that takes 800 MB of memory? And why would a modern GUI program not utilise memory if it's available and it's free in order to cache data, requests, build an in-memory database, and so on? Browser programming is a lot more than finding the shortest path in a graph. It's commonplace to have 4-10GB of free memory at any given time and it should be utilised if it's available instead of being wasted by being unused.
Re:Electron 2.0.0 beta by dvfjsdhgfv on Thursday February 22, 2018 @05:41AM (#16436662)
> It's commonplace to have 4-10GB of free memory at any given time and it should be utilised if it's available instead of being wasted by being unused.

I'm not sure when this became the new normal, but I was taught the exact opposite. How about trying to squeeze that into 200 MB rather than allocating 4-10 GB just because it happens to be available at that moment?

Re:Electron 2.0.0 beta by nukeop on Thursday February 22, 2018 @06:52AM (#16436934)
For some purposes, you can't "squeeze that into 200 MB", especially for caching. If you have memory that's lying around empty, what is the point of having it at all if it's wasted 99% of the time? Is it a virtue in itself to under-utilize resources you have available?

Is it good if a company employs a 100 people but only 15 of them do work and the rest is idle?

Re:Electron 2.0.0 beta by dvfjsdhgfv on Thursday February 22, 2018 @08:07AM (#16437256)
First of all, yes you can, even easily - provided that you use a different GUI toolkit. 200 MB is a huge amount of memory anyway, in many cases you can do much better. Electron fans like to talk about caching, but really, that's a browser issue, it has nothing to do with GUIs, at least not with traditional ones. Why should you need to cache any GUI elements if you can (re)create a thousand dialogs in a blink of an eye? Maybe you can cache the _data_ in those windows, but that's a completely different thing, and the memory used is usually some orders of magnitude lower.

Now, as for using all available memory: that's exactly the reasoning that causes so much problems for users, and that's why after so many years of hardware upgrades our machines still feel sluggish: using all resources for your app, only because they happen to be free at that moment, is not OK.

First of all, they are free now, but they might not be a moment later (because another brilliant app author has the same idea and tries to allocate everything). Second, the resources should be used in a reasonable way. If a piece software doing extremely simple computation is suddenly allocating a few gigs of RAM and takes over all cores, my thought isn't "Oh, what an efficient app, it's using all these resources I don't need", but I wonder what went wrong! What is perfectly OK for, say, a 3D rendering node, is completely wrong for an app that could do the same thing with 10x lower resource usage.

I'm not sure if I am able to explain it in more clear terms.

Re:Electron 2.0.0 beta by nukeop on Thursday February 22, 2018 @10:12AM (#16438031)
So you're saying increased resource usage is ok for node, but did you know that node is exactly what electron is running on? 200 MB of memory is nothing for a GUI app - and most Electron apps don't even take 100. They need that memory for all these amazing features the framework offers, like running javascript, processing css stylesheets, async execution, etc.
Re:Electron 2.0.0 beta by dvfjsdhgfv on Thursday February 22, 2018 @12:18PM (#16439225)
No, by "3D rendering node" I don't mean Node.js but a node (like in a cluster) of a 3D rendering engine.
Re:Electron 2.0.0 beta by rk06 on Thursday February 22, 2018 @08:16AM (#16437306)
> For some purposes, you can't "squeeze that into 200 MB", especially for caching

The thing is native apps can do that, and more in less memory. The baseline here is set by "how much is needed", not "how much memory is available".

>Is it good if a company employs a 100 people but only 15 of them do work and the rest is idle?

Yes, if 15 can do the job. then rest can moved for other profitable purposes, or laid off.

Re:Electron 2.0.0 beta by imtringued on Thursday February 22, 2018 @09:49AM (#16437867)
You hired those 100 employees for a reason: future growth. If you decide to employ them as subsistence farmers you're not only lacking employees in the future you're also bleeding money left and right.
Re:Electron 2.0.0 beta by imtringued on Thursday February 22, 2018 @09:48AM (#16437853)
That's an extremely terrible strategy.

It's the OS's job to use the free memory for caching the filesystem. If you have special workloads that benefit from more memory you usually change an entry in a config file to the appropriate value or change a settings in the GUI. That's it. No you don't just try to consume as much memory as possible for no reason. You're messing with the OS's ability to use the memory optimally. It's not wasted, you're the one who's wasting it.

Re:Electron 2.0.0 beta by cesarb on Thursday February 22, 2018 @09:05AM (#16437577)
> It's commonplace to have 4-10GB of free memory at any given time

An entry-level computer nowadays has 4GB of memory. Not free memory, total memory. That 4GB has to be shared between the operating system, all running apps, and the disk cache.

> and it should be utilised if it's available instead of being wasted by being unused.

If it's available, any modern operating system will use it for the disk cache, instead of leaving it unused.

Re:Electron 2.0.0 beta by imtringued on Thursday February 22, 2018 @09:21AM (#16437668)
I use firefox and according to about:memory gitter uses about 20MB per tab and rocketchat about 50MB. Those at are the biggest memory hogs. The average tab with a static page uses around 4-5MB. On the other hand I see a lot of "fixed" cost

These values may not be accurate because they don't include images but they are still very far away from a blanket statement like "150MB per tab".

Clearly we can see that electron has a lot of room for potential and if they fix these flaws there would be no need to critize it, yet they don't even give the slightest damn about it.

Re:Electron 2.0.0 beta by dingo_bat on Thursday February 22, 2018 @05:09AM (#16436546)
So if it uses up to 150MB, it is not wasted and if it uses more then it's the user's (dev building on electron) fault. Got it. Electron is never at fault.
Re:Electron 2.0.0 beta by ghostcluster on Thursday February 22, 2018 @02:38AM (#16435903)
scanned the changelog for any mention of performance or memory footprint optimizations. nothing.
Re:Electron 2.0.0 beta by erulabs on Thursday February 22, 2018 @04:48PM (#16441736)
Updated V8, Node, and Chrome? That's the performance gain...