News for hackers. Stuff that matters.
Re:Electron 4.0.0 by Djvacto on Friday December 21, 2018 @10:45AM (#18733989)
I always read about how Electron is very resource-intensive, but I'm curious as to how the performance improves as time goes on?

Does the Electron team have a focus on improving performance? Or is the issue with the developers using electron, should they be optimizing better?

I assume it's some of both, but curious if anyone with more experience in electron can provide any insight as to how the performance changes over time.

Re:Electron 4.0.0 by accatyyc on Friday December 21, 2018 @10:52AM (#18734040)
The issue itself is that Chromium uses a lot of memory. And electron basically just runs Chromium. Except that since each Electron-based app ships its own very isolated copy of Chromium, the following problems occur:

- The operating system cannot share memory between different Electron processes. Normally if you start many processes of the same binary, the memory is shared and only copied on write. Since each Electron app is a different binary (even though they are 99% identical) they each eat memory.

- The above applies to disk size as well. Electron apps are usually huge, and 99% of the binary is the same as all your other electron apps.

This is mostly why I'm against electron. If electron worked like the JVM and each app shared a runtime, many issues would be solved, including many electron apps running old, and vulnerable versions of Chromium. Now it's only updated if the developers decide to ship a new version.

Re:Electron 4.0.0 by scoopdewoop on Friday December 21, 2018 @11:47AM (#18734516)
It is absurd the people that show up out of the woodwork every Electron article to complain about performance. Meanwhile, I have not closed Discord for more than a day or two in years. A quick Ctrl-Shift-Esc shows that it is using 180MB of RAM right now with ~20 rooms open, as well as DMs. Meanwhile, Discord has fantastic uptimes and never impedes performance while competitive online games run alongside it. The idea of trying to replicate the interface in something like tkinter is cringeworthy at best. Discord supports animated gifs, modals, videos, emojis, fonts, code samples, markdown, and game integrations right in the chat! Please, please try and replicate that with Tkinter, an API where you'd need to roll your own drag-and-drop. If i want to run discord as a website, using the same resources as any other website, i CAN! Its the same codebase and interface. I run the full desktop client for the better filesystem, game, and chat integration and it is worth the measley RAM on my modern machine.

Discord is an intelligent start up that was able to pivot from a chat client to a games marketplace with a one-click update. Their use of the erlang VM shows that they make considered tech decisions based on tested technology. I think their use of electron, at least from this users perspective, was a great decision. I realize they are just one example of electron apps, and I'd have a harder time defending a file-unzipper or some madness using Electron, but it no doubt has its uses. To suggest otherwise would be premature optimization at best.

Re:Electron 4.0.0 by accatyyc on Friday December 21, 2018 @12:52PM (#18735018)
Telegram for example supports most of Discords features, is native, and is incredibly fast.

I use Discord and like it, but it is incredibly slow at starting, switching rooms, and even just loading new messages.

But the most aggravating thing is that I can't type a message on mobile if I don't have internet connection. It requires connection to load the input field. Affects me every day in elevators. Most native apps just lets you write your message and sends it when connection is back.

Fine, Discord is useful, but I must respectfully disagree that their app is good. And it is definitely possible to make natively.

Re:Electron 4.0.0 by solarkraft on Saturday December 22, 2018 @08:22AM (#18740468)
Telegram has more features that I really care about than Discord (#1: Replying to messages).

Telegram on mobile is Android native, while Discord is based on "React Native". Telegram for desktop is based on Qt while Discord uses Electron.

Re:Electron 4.0.0 by chipotle_coyote on Friday December 21, 2018 @02:23PM (#18735790)
How about trying to replicate all those things in Cocoa, GTK, or WPF? When people kvetch about Electron performance relative to native apps, this is what they mean. At least over here in Crazy Finicky Mac User Land, I tend to be at least as concerned that Electron apps are just lousy Mac citizens. It's not just that they don't look like other Mac apps, they don't support Mac UI conventions and frequently don't support system services and scriptability.

It seems to me that most apps are written in Electron for two reasons: it lets you write apps in JavaScript that are conceptually very similar to web apps, so you're not learning a new weird-to-you language like C# or Swift, and it lets you go cross-platform with far less effort--you're writing one app rather than three. But this doesn't mean that you're not making tradeoffs in both performance and usability when you choose to go this route.

There may come a point in time when a well-written native app won't trounce an Electron-based app in terms of memory footprint, startup time, and integration with the host platform. But that time is not now, and it's silly to pretend otherwise.

Re:Electron 4.0.0 by gumby on Friday December 21, 2018 @06:13PM (#18737569)
> ... I tend to be at least as concerned that Electron apps are just lousy Mac citizens. It's not just that they don't look like other Mac apps, they don't support Mac UI conventions and frequently don't support system services and scriptability.

Which is the case with Chrome itself too...a pretty unpleasant experience on the Mac if you have finger memory or want to use your apps together. Sigh.

Re:Electron 4.0.0 by Ari_Ugwu on Friday December 21, 2018 @03:43PM (#18736478)
I also understand this critique but feel it's a bit hollow. Or at least I feel that despite billions of dollars in available funds the big software producers failed to create a solution that is better. They are simply unable or unwilling despite having the resources and a lock on the top engineering talent in the space.

I wish and hope that MS moving Edge to chromium is to provide a single host level run time for PWAs. It's a space they have flirted with and seem to be inching towards more quickly.

Also note that there is nothing keeping developers from adhering to Mac UI conventions that I know of. That's not a fault of Electron at all.

tl;dr - If Javascript and electron are winning it's because others are continually _failing_.

Re:Electron 4.0.0 by chipotle_coyote on Saturday December 22, 2018 @06:11PM (#18743028)
Adhering to Mac UX conventions is harder with Electron, because a lot of little things that apps get "for free" with the native toolkit have to be explicitly included or even re-implemented under Electron. Visual Studio Code, for instance, has explicit support written in it to be able to use macOS Services; earlier versions of Code just didn't work with them. If its UI was written in Cocoa, this would have just come along for the ride. And at least off the top of my head, I can't think of a single Electron-based app that I use which fully behaves like a Mac app in other subtle ways; for instance, Slack, Telegram, Atom, and Code all do their own weird things to control their settings rather than bring up a modeless preference window the way every native Mac app does. Maybe it's modal! Maybe it's modeless! Maybe it's a JSON file! Who the hell knows. Does it bring up any internal windows that look like the native OS's windows? Does it support all the common text editing keystrokes that Macs have supported since 1984? Does it even integrate with the system font selection system? [shrug emoji]

I presume this is true for other platforms/toolkits as well, and it's a tradeoff that doesn't get talked about as often as it probably should be. I'm not using a Mac because I woke up one day fifteen years ago and said, "You know, I'd love to pay a lot more for hardware than I probably should just so I can get minimalist industrial design, too few ports, and dubious keyboards." I use them because I like Mac UX conventions. I've talked to many people who actively prefer Windows UX conventions, or KDE or Gnome. I am not thrilled with the notion of a world where everything is a pseudo-native PWA.

Re:Electron 4.0.0 by jf- on Friday December 21, 2018 @03:21PM (#18736273)
> There may come a point in time when a well-written native app won't trounce an Electron-based app in terms of memory footprint, startup time, and integration with the host platform. But that time is not now, and it's silly to pretend otherwise.

It's also silly to pretend that users will notice or care, assuming a well written electron app. Again, look at VS Code. Now assume that the app is aimed at a non-technical audience who aren't going to be examining their resource monitors and who would never describe anything as a Mac citizen. If the customer doesn't notice or care, then the superiority of native apps does not exist.

Re:Electron 4.0.0 by exitcode00 on Friday December 21, 2018 @12:45PM (#18734964)
It doesn't take that advanced of a programmer to know that a simple chat client like discord or slack should not take seconds (on the order of 5 to 6) to load! We are running super computers here!

https://medium.com/commitlog/electron-is-cancer-b066108e6c32

Re:Electron 4.0.0 by sime2009 on Friday December 21, 2018 @12:58PM (#18735063)
Maybe you should go back and read scoopdewoop's comment again. Half of their point was that slack and discord are not simple text only chat clients.
Re:Electron 4.0.0 by AnIdiotOnTheNet on Friday December 21, 2018 @02:16PM (#18735742)
They don't really do anything more complicated than a reasonably fancy IRC client did in 1995, yet I bet you they're a lot slower to do it.
Re:Electron 4.0.0 by orf on Friday December 21, 2018 @07:12PM (#18737937)
Yeah, it's totally fair and correct to say that slack doesn't do anything more complicated than an IRC client did in 1995.

Try using the global search feature on Slack and tell me how that already existed in IRC circa 1995.

Re:Electron 4.0.0 by eitland on Saturday December 22, 2018 @02:28AM (#18739468)
> Try using the global search feature on Slack and tell me how that already existed in IRC circa 1995.

Isn't that particular feature mostly implemented server side?

On the other hand, yes, I agree that modern messengers has a lot of features that my IRC clients missed (voice comes to mind). Also they are easier for mainstream users to use and administer, and, compared to old IRC, safer in a number of ways (although I'd add that we are seeing a number of new threats now).

Re:Electron 4.0.0 by exitcode00 on Friday December 21, 2018 @01:11PM (#18735199)
Ok, perhaps that was an over simplification - they are "complicated chat clients", but that still doesn't excuse the fact that massive industrial programs start instantly nowadays if they are native - think Unreal Engine, 3ds Studio Max, Blender, Sublime Text, the list goes on
Re:Electron 4.0.0 by tinco on Friday December 21, 2018 @10:26PM (#18738735)
What universe do you live in where unreal engine launches in less than 30 seconds?
Re:Electron 4.0.0 by jf- on Saturday December 22, 2018 @06:03AM (#18740074)
A useful heuristic: anyone who's argument is of the form "x is cancer" can safely be ignored.
Re:Electron 4.0.0 by seba_dos1 on Friday December 21, 2018 @12:06PM (#18734645)
Not commenting on anything else, but Discord app consuming 180MB RAM sounds like a mismeasurement. Here it takes almost 0.5GB right after launching.
Re:Electron 4.0.0 by mbell on Friday December 21, 2018 @12:42PM (#18734937)
They are most likely only looking at the RAM used but the 'Discord' process, which is just the native launcher code and OS hooks (on MacOS here, may be different on other OSes). The electron processes are called 'Discord Helper' and will be using quite a bit more RAM, though I still wouldn't consider it 'heavy'. The same process structure is true of Slack as well (maybe all electron apps, I'm not familiar enough to say).

Both Slack / Discord use around 400MB including all processes on my machine, tho it certainly varies with what is on screen. In comparison to the gmail tab I have open in Safari that is using 1GB, 400MB isn't bad.

Re:Electron 4.0.0 by pseudalopex on Friday December 21, 2018 @03:12PM (#18736199)
400 MB is enough to run Mail and Messages with room to spare.
Re:Electron 4.0.0 by com2kid on Friday December 21, 2018 @01:06PM (#18735148)
The Facebook Messenger tab in my browser consumes way more memory than that if left open.

Heck my Digital Ocean dashboard tab is consuming 155MB of memory right now (WTF DO?)

That said, I am blown away whenever I install an "old school" native Win32 app. The 90s APIs may have sucked to program for, but the end results stood the test of time.

Re:Electron 4.0.0 by exitcode00 on Friday December 21, 2018 @01:36PM (#18735427)
Exactly, look at the "system" requirements for AOL Instant Messenger:

Windows 2000 or higher Internet Explorer 6.0 or higher 128MB RAM/512MB for enhanced multimedia features (TOTAL RAM in the system!!!!!) Macromedia Flash Microphone and speakers/headset for voice/audio chat

Re:Electron 4.0.0 by M4v3R on Friday December 21, 2018 @12:17PM (#18734720)
It takes about 0.5 GB for me as well, but shared across three processes (main app and two "helpers"). Maybe parent commenter looked only at the main app's usage?
Re:Electron 4.0.0 by scoopdewoop on Friday December 21, 2018 @12:32PM (#18734834)
Could be, but I just checked again and the App takes ~29MB, and the two background processes take ~24 and ~136 for a total under 190MB. Whether it uses 1.5% or 4% of my RAM is meh either way in this case. Windows 10
Re:Electron 4.0.0 by tomc1985 on Friday December 21, 2018 @12:36PM (#18734867)
> replicate that with Tkinter, an API

Who are all these masochists using Tkinter? There are a ton other APIs to consider, and even more if one wouldn't mind updating an old one to be current (think XUL). I think this is the second or third thread where that particular toolset has been named as if it were the only alternative to Electron

I hate Electron too but is everyone really so new to the game that they do not remember desktop programming?

There's Swing, GTK, QT, JavaFX (maybe), WinForms....

Re:Electron 4.0.0 by JetSpiegel on Sunday December 23, 2018 @09:16AM (#18746166)
> Who are all these masochists using Tkinter?

embarassed hand raise

It's not that bad, just pretty bad.

Re:Electron 4.0.0 by burtonator on Friday December 21, 2018 @12:20PM (#18734743)
I'm working on an app that uses both PDF and web content to build a document repository that allows you to manage your reading with tags, annotations, etc: https://getpolarized.io/

The issue with memory consumption is definitely there.

But the issue for us is that if you're doing ANYTHING with 'content' you just have to use the web platform.

You need CSS, HTML and with pdf.js we have somewhat first class PDF support (though a few features are missing).

If it's a calculator app, then sure. Don't use Electron. It would be too bloated.

One feature in Polar that simply wouldn't be possible is support for web content caching.

We support downloading web pages for offline usage to allow annotation and to prevent bit rot.

It wouldn't be possible without some sort of web control but having full chromium (plus a webserver) means that you can setup a near perfect clone of the web but on the desktop.

Re:Electron 4.0.0 by rrosen326 on Friday December 21, 2018 @12:26PM (#18734790)
[aside] @burtonator - what do you use for your pdf rendering? pdf.js? When I used electron a while ago it didn't natively support PDFs so you needed to roll your own with pdf.js. And the UI code to get full-featured PDF support (like a native browser) was quite complicated. Just curious if you found an easier way.
Re:Electron 4.0.0 by dreix on Friday December 21, 2018 @04:18PM (#18736736)
It does kinda support Pdf out of the box but is currently broken. there's an open issue. The last working version with a PDF viewer is 2.x.
Re:Electron 4.0.0 by burtonator on Friday December 21, 2018 @02:15PM (#18735733)
pdf.js... it works just fine ;)
Re:Electron 4.0.0 by Klonoar on Friday December 21, 2018 @02:10PM (#18735701)
These are the same people who don't understand that a default, do-nothing app on something like macOS will be minimum 20MB due to the window backing.

I have a theory that the loudest complainers about this are the leftovers of the computer ricer era, who liked to display a bunch of metrics on their screen that mostly amounted to fluff. Electron solves real problems.

Signed, someone who's built and shipped native apps on the various platforms, and groans anytime he has to do a basic chart or whatever because it'd be 10000x easier in a web browser.

Edit: furthermore, the browser handles caching things like images and what not, which bloats up the memory in Electron. There is a way to force the browser to flush that stuff out, but nobody does it. If you have a local image cache for a native app and you don't flush it, you will get the exact same situation.

Re:Electron 4.0.0 by solarkraft on Saturday December 22, 2018 @08:33AM (#18740500)
180MB of RAM is an absurdly high amount.

This application's purpose is to show text and little pictures (and occasionally process a few low-bit rate audio streams).

It is amazing that modern application developers are turning well solved problems for 90s computers into tasks modern computers can barely process.

Re:Electron 4.0.0 by plorkyeran on Friday December 21, 2018 @02:59PM (#18736094)
I have to restart Discord on a daily basis on macOS to avoid having it use multiple GB of RAM. Currently it has 3 processes running which are using 100 MB, 120 MB, and 1.2 GB of ram respectively.
Re:Electron 4.0.0 by PieUser on Friday December 21, 2018 @12:11PM (#18734672)
It's not just RAM it's also disk space usage. For instance Atom (text editor) takes more than 800MB of disk space on my Mac.
Re:Electron 4.0.0 by fabiospampinato on Friday December 21, 2018 @12:14PM (#18734692)
Well that doesn't tell me much about Electron, the latest Visual Studio Code for macOS that I just downloaded weighs less than 200MB.
Re:Electron 4.0.0 by JensRex on Friday December 21, 2018 @02:43PM (#18735941)
A 200 MB text editor, no matter how fancy, is also insane.
Re:Electron 4.0.0 by codezero on Friday December 21, 2018 @03:35PM (#18736393)
Is someone forcing you to use Electron based tools against your will? The last three comments you’ve made on HN are gripes about it, it sounds like you’ve got an axe to grind.

Back when I had four megabytes of ram I wouldn’t have been furious over a 50kb editor. 200mb isn’t a lot when most developers are working on systems with 16gb or more of memeory.

Re:Electron 4.0.0 by JensRex on Friday December 21, 2018 @07:13PM (#18737942)
My last comment on HN was four months ago, and incidentally also about Electron. No, nobody has a gun to my head, but a sadly increasing number of applications are Electron based, some of which I'm "forced" to use.

Yes, I hate Electron with a passion. It's a slow, wasteful framework for lazy developers who can't be bothered learning Qt or something else non-silly. IMHO.

Re:Electron 4.0.0 by toyg on Friday December 21, 2018 @06:49PM (#18737786)
The comparison is silly: in 4mb-era one didn’t have to run docker instances and assorted VMs and databases (yes, you can do it in the cloud, but that’s not cheap). Most dev stacks were CPU-bound, now they are mostly memory-bound. That’s why devs are memory-hungry, not because they want 3d emojis.
Re:Electron 4.0.0 by codezero on Friday December 21, 2018 @11:47PM (#18738972)
I’ve had no problem running 10+ containers while running Slack, Chrome, and a few other Electron based apps simultaneously and have never really had problems except for the heat it generates.

If a dev is working on a less capable machine I guess I can see why this is a problem, but a rather simple one to solve, close Slack, it’s a distraction to focused work anyways :)

Re:Electron 4.0.0 by pseudalopex on Friday December 21, 2018 @03:01PM (#18736105)
Electron seems to use less memory on Windows. Also, Discord seems to be more efficient than other Electron chat apps.
Re:Electron 4.0.0 by ksec on Friday December 21, 2018 @12:07PM (#18734655)
On the other hand WhatsApp on Mac is using up to 1GB of RAM and doing abosutely nothing.
Re:Electron 4.0.0 by zimpenfish on Friday December 21, 2018 @03:07PM (#18736159)
On the other other hand, my WhatsApp is currently using 87.6MB (WhatsApp) + 115.3MB (WhatsApp Helper) + 99.8MB (WhatsApp Helper) for a total of 302.7MB.

(Creative Cloud is using 234.9MB and that's nothing more than a damn launcher!)

Re:Electron 4.0.0 by ksec on Friday December 21, 2018 @11:41PM (#18738950)
I just downloaded the latest WhatsApp update, ( I think it was released a few days ago ).

Now it is 164MB + 104MB + 85MB! And these measurement were not under high memory pressure! This isn't small by any means, still a total of ~350MB for a simple tool, but it is similar to Telegram which is a native Mac App. The two WhatsApp helper were previously using 700MB each!

And the major major improvement is compressed memory. Previously it didn't compress much at all. It was the same 700MB. Now it is 4.6MB + 5.2MB + 8.5MB, that is total of 18.3MB!!!!

I have no idea what happened, but in terms of compressed memory that is nearly 99% reduction in memory!

( Actually I am really interested in what happened, I wish they have changelog or blog post on the fix )

Re:Electron 4.0.0 by ksec on Saturday December 22, 2018 @03:53AM (#18739707)
5 Hours later, 250MB + 250MB + 90MB. That is 590MB, so may be it wasn't as good as I thought.
Re:Electron 4.0.0 by ksec on Sunday December 23, 2018 @12:01AM (#18744541)
And 24 hours later, All WhatsApp Added up to 1.2GB. So your figures were completely wrong.
Re:Electron 4.0.0 by zimpenfish on Sunday December 23, 2018 @05:32AM (#18745405)
No, my figures are still correct. That was the state of my system at the time.

Right now (20181223T1031Z) WhatsApp (87.5MB) + WhatsApp Helper (149.9MB) + WhatsApp Helper (171.7MB) are using a total of 408.5MB.

Everyone's system is different. Everyone's WhatsApp is different. Everyone's memory usage will be different.

Re:Electron 4.0.0 by zozbot123 on Friday December 21, 2018 @12:02PM (#18734617)
> animated gifs, modals, videos, emojis, fonts, code samples, markdown, and game integrations

Noted, and that's a fine use case for the Browser engine + HTML + CSS + JS/WASM tech stack - but how many native apps need that sort of rich view?

Re:Electron 4.0.0 by PaulHoule on Friday December 21, 2018 @10:57AM (#18734072)
Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

Lately I have been building apps with tkinter/python/asyncio and I can't get over how fast the apps are to load and to use. There is none of this "let's not respond to the mouse for 5 seconds" that is staggeringly common on my mac (particularly for apps like Safari and iTunes that come from Apple) nor the "go for a walk around the block" loading times for Java-based apps on my i7 Windows laptop.

True tk apps are ass-ugly but I find it mind-blowing to use GUI apps that are as responsive as Windows 95 apps were back in the day.

Re:Electron 4.0.0 by androidgirl on Friday December 21, 2018 @11:04AM (#18734126)
The aversion is mostly that a lot of devs have learned to use html, css, and js for styling ui's.

I love Kivy as well as QT. You can make some decent looking apps with the former and some incredible ones with the later. I have never personally worked with Electron.

But yeah, most devs use JS, HTML, and CSS for ui creation because of the Web.

I think something like QML could replace the html and css parts, though.

Re:Electron 4.0.0 by giobox on Friday December 21, 2018 @11:29AM (#18734350)
To add to this point, virtually all software companies have devs with web dev experience that can be very easily leveraged with Electron. Native app development skills aren’t nearly as prevalent in most organisations in my experience. The success of electron has never been that much of a surprise to me: write once, ship (almost) everywhere, use the team you already have. Often cheaper than upskilling the team as well.
Re:Electron 4.0.0 by shaan7 on Friday December 21, 2018 @11:13AM (#18734211)
> Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

Um because a lot of them already know HTML/CSS/JS (because they've worked on websites). This the the major reason why Electron is popular - the barrier to entry is very low. That combined with the fact that users don't complain, just makes it a "pragmatic" choice.

Re:Electron 4.0.0 by jayflux on Friday December 21, 2018 @02:08PM (#18735682)
Basically this. Electron has a low cost/benefit. Yes some will not be happy with resources usage, but I doubt this is the majority.

I haven’t heard anyone outside of the hn circles moan about slacks usage.

Re:Electron 4.0.0 by fabiospampinato on Friday December 21, 2018 @11:29AM (#18734347)
I've made a few Electron apps, I don't use other cross-platform UI toolkits mainly for these reasons:

- I'm a JS/TS developer, with it I can make CLI apps, websites, Electron apps and mobile apps. This means I can also use the same set of UI widgets I'm familiar with across all platforms, I can't do that with any other native UI toolkit so far, maybe the situation will change with the advent of WebAssembly, but so far JS has basically been the only language capable of providing this.

- I don't think I've ever used a Java GUI app that didn't look like crap and wasn't a game, I've also never made a GUI app in Java, so this is just a guess, but maybe it's just easier to make prettier apps with web technologies.

Re:Electron 4.0.0 by AnIdiotOnTheNet on Friday December 21, 2018 @12:41PM (#18734926)
It's easier to make GUIs that suit the developers own tastes with web tech than with real toolkits. Whether or not that is a desirable quality in applications is a matter of debate.

Personally, I liked it back in the Win95 days when everything used the native toolkit and I could change its appearance significantly through a simple control panel [0]. Back then, if I wanted a "dark mode" I just adjusted colors to make things darker, but with modern GUI bullshit it's a newsworthy item when someone adds "dark mode" as a feature.

[0] http://toastytech.com/guis/win95schemes.png

Re:Electron 4.0.0 by fabiospampinato on Friday December 21, 2018 @12:56PM (#18735047)
If you've tried VS Code, is it of desirable quality to you? If not why?

Customizability-wise I actually prefer Electron apps to native ones, with a few lines of CSS I can remove stuff I don't need and tweak the UI a bit, I'm not quite sure you can do the same as easily for native apps.

Also you mentioned dark mode, an Electron app could support dark mode too, taking as an example macOS native apps they also have to explicitly support dark mode, so I'm not sure what you lose in this regard by non going native.

I would argue that going full-native win95 style has more downsides than benefits, for most people simply being able to change the wallpaper is enough.

Re:Electron 4.0.0 by AnIdiotOnTheNet on Friday December 21, 2018 @02:12PM (#18735714)
> Customizability-wise I actually prefer Electron apps to native ones, with a few lines of CSS I can remove stuff I don't need and tweak the UI a bit, I'm not quite sure you can do the same as easily for native apps.

That's a fair point. GUIs have tended towards being less customizable, not more, and that's a huge failure in my eyes. However, the customizability of Electron applications is really a side effect of the fact that it runs on top of a web browser. I find it difficult to count that as a point in its favor.

Looking at it from that perspective, there are native GUI systems that load XML files for their GUI that could also be called customizable by your standard.

Re:Electron 4.0.0 by pseudalopex on Friday December 21, 2018 @03:50PM (#18736525)
VS Code uses almost as much memory as a full IDE but does less. Sublime Text does almost as much as VS Code and uses much less memory, loads large files much faster, and opens new windows instantly. The last time I checked, VS Code didn't support Services on macOS or standard menu keyboard shortcuts on Linux.

Native apps use system colors by default. Electron apps tend to use static colors.

Re:Electron 4.0.0 by DenisM on Friday December 21, 2018 @11:58AM (#18734582)
How about Xamarin? It doesn’t give you a website, but it seems to cover the rest.
Re:Electron 4.0.0 by fabiospampinato on Friday December 21, 2018 @12:17PM (#18734721)
Well if I can't use the same UI components I spent years developing everywhere then this is a deal breaker for me.
Re:Electron 4.0.0 by DenisM on Friday December 21, 2018 @01:52PM (#18735559)
It's a bit of a circular argument: "I'm invested into using X therefore X is a good choice". This tells us nothing about the quality of X, although I'm sure it means the world to you personally.
Re:Electron 4.0.0 by fabiospampinato on Friday December 21, 2018 @01:59PM (#18735596)
That's why I said _for me_.

I've no idea how good Xamarin is at doing the things that it does, but even if I hadn't invested X into my web-based components Xamarin would still force me to reimplement them again in case I need them in my website. That's not cross-platform enough for me, Electron in better in this regard.

Re:Electron 4.0.0 by fabiospampinato on Friday December 21, 2018 @12:57PM (#18735060)
Why the downvote?
Re:Electron 4.0.0 by DenisM on Friday December 21, 2018 @01:55PM (#18735573)
Pay no attention to the spurious "background cosmic radiation" downvotes, it averages out over time anyway.
Re:Electron 4.0.0 by airstrike on Friday December 21, 2018 @11:05AM (#18734140)
My 2 cents is that tk apps look ugly AF as you mentioned and that GUI programming is a hard and thankless job... so people want to skirt around it by leveraging CSS which they already know.

Also if it's not built in JS, it's not cool these days

Re:Electron 4.0.0 by ergothus on Friday December 21, 2018 @11:19AM (#18734261)
> Also if it's not built in JS, it's not cool these days

To me, it feels like if you want to be cool these days, you look down on JS/JS devs.

JS has plenty of issues, but it's undeniably successful - isn't it more beneficial to either improve the problems or figure out why it continues to be successful despite them and adapt that in your language of choice rather than dismiss the success as being "cool"?

I've developed in a few languages, with JS being the latest, and while I do in fact enjoy it (mostly), it's not because I'm cool. I'm almost never cool, and being a JS dev involves people telling me that remains the case in tech forums regularly.

</rant>

All of my bitterness aside, your point about GUI development is completely correct. I've been happy to see CSS slowly taking lessons from desktop GUI layout and hope for more in the future.

Re:Electron 4.0.0 by kbenson on Friday December 21, 2018 @11:28AM (#18734345)
> To me, it feels like if you want to be cool these days, you look down on JS/JS devs.

The true hipster developer needs to be able to sneer at JavaScript with true derision while also having JavaScript be their go-to language for everything. Holding incompatible views at the same time about mostly inconsequential things is, after all, the true essence of being a hipster...

Re:Electron 4.0.0 by swasheck on Friday December 21, 2018 @12:27PM (#18734794)
The pervasive belief that how it looks is better than how it works. End-users can be conditioned to wait for the application to catch up if it looks nice. If it's ugly, most folks will simply lose interest.

I prefer functionality over appearance, but I'm just a crusty old RDBMS DBA so I'm not sure my opinion can count for much.

Re:Electron 4.0.0 by eddieroger on Friday December 21, 2018 @11:02AM (#18734108)
Do they think that? I think more what thing here is that Electron apps are popular with UI developers who want to make the jump from web apps to native apps without taking the time to learn the platforms, or wish to reuse components they use on their web apps.
Re:Electron 4.0.0 by marmaduke on Friday December 21, 2018 @11:43AM (#18734479)
I wrote one GUI app in PyQt, and (ab)used the ability to put keyboard accelerators everywhere. Combined with a menu system, the whole thing was as-fast-you-can-think, like vim, but well a GUI.

So yes +1 cross platform GUI toolkit

Re:Electron 4.0.0 by kodablah on Friday December 21, 2018 @11:44AM (#18734483)
Because people don't want to write Python or C++ and I don't blame them. Why is it that people don't recognize that people don't want to marry an ecosystem for a UI?

If we could just get a modern UI lib w/ a C FFI you'd see a node wrapper and the complaints would reduce (yes I am aware of lots of efforts and could enumerate them all, but many are lacking).

Re:Electron 4.0.0 by mroche on Friday December 21, 2018 @11:07AM (#18734164)
I think it’s primarily due to ease of use. Granted, I’m not an Electron dev, but I believe most “modern” developers would have an easier time writing a UI and application using HTML/CSS/JS, than a language like Python/C++/Java.

I’m incredibly partial to Qt and love the framework (particularly the ability to style it and its C++/Python bindings). But even after making a small GUI application I can see why some would prefer more simple to use frameworks, whatever the resource or performance costs may be.

Re:Electron 4.0.0 by zozbot123 on Friday December 21, 2018 @11:48AM (#18734521)
> I think it’s primarily due to ease of use.

Ease of use? What's easier, MS Visual Basic/Embarcadero Delphi, or the application-oriented parts of HTML/CSS/JS? Even Python (which is freely available) is not exactly hard, and there are plenty of native apps using e.g. WxPython. It's not "ease of use", it's more like webdev "brogrammers" wanting to have their cake and eat it too.

Re:Electron 4.0.0 by gronne on Friday December 21, 2018 @12:16PM (#18734708)
Agreed! tkinter is blazing fast and frankly I don’t give a damn about the looks if it means I can solve problems faster and with less errors (ex when I keep a lot of data in my wetware memory).
Re:Electron 4.0.0 by passthejoe on Friday December 21, 2018 @12:07PM (#18734648)
I'm dealing with this same issue. One thing contributing to the hand-in-toilet feeling is that you go and look for tutorials, books, even documentation on Tk and how it works with any given language, and most of what you find is 10 years old or older. Nobody appears to be using the cross-platform toolkits, unless you count QT and/or GTK.

It looks like Python is your only option if you want a community of any sort who is actually doing GUI development with a scripting language (Perl/Python/Ruby)

Re:Electron 4.0.0 by zaro on Saturday December 22, 2018 @08:30AM (#18740489)
> Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

Because it very much feels like so, especially with tkinter. And it's not only the toolkit, it's the OS integration, and installer and so on. Because making a cross platform app with Electron is relative low effort and you get very good results. Most of the other options are not even close.

Re:Electron 4.0.0 by rcarmo on Saturday December 22, 2018 @04:31AM (#18739828)
I’ve been tinkering along that same path (for small utilities that wrap CLIs and file manipulation libraries) and have used ttk for a “native” look and feel that isn’t quite right.

I think an updated, nicer ttk would help considerably, as well as a bigger widget library, but there is little information on improvements to Tk as a whole (I can’t even find enough examples for asyncio...)

Anyone have good references for either?

Re:Electron 4.0.0 by jniedrauer on Friday December 21, 2018 @11:04AM (#18734130)
> Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

tkinter specifically does not look very pretty without some effort. I would much rather use GTK or QT. The problem is GTK support on windows is limited, and QT has a weird license model.

Re:Electron 4.0.0 by blattimwind on Friday December 21, 2018 @11:11AM (#18734187)
> QT has a weird license model.

Qt is available under LGPL and GPL. What exactly is weird about that?

Re:Electron 4.0.0 by jniedrauer on Friday December 21, 2018 @12:18PM (#18734730)
Looks like it's changed since I last looked into it. Probably a good option now.
Re:Electron 4.0.0 by blattimwind on Friday December 21, 2018 @12:26PM (#18734789)
Qt had been available under the LGPL since 2009.

Up until 2005 or so Qt had indeed a relatively complex licensing scheme where the available (i.e. the license of Qt) and compatible (i.e. the license of the application, due to their GPL exception allowing applications to use MIT, BSD, ...) differed by what was then Qt ports (e.g. Qt/X11, Qt/OSX, Qt/Windows). After that they always had a uniform licensing model for Qt, were the licensing was independent of the platform.

Re:Electron 4.0.0 by PaulHoule on Friday December 21, 2018 @12:12PM (#18734678)
I have found installation of tkinter on Windows and MacOS is easy, which I can't say is true for GTK, QT or Kivy.

I wanted to like Kivy but it was more clear how to get asyncio support running w/ tkinter. The Kivy folks say they will go to py 3 only soon and support asyncio officially soon but I am in a good place with tkinter.

I am also thinking about a 2-thread architecture which may work well for Kivy since it is so heavily Cythonized.

Re:Electron 4.0.0 by e1ven on Friday December 21, 2018 @11:06AM (#18734151)
Isn't QT LGPL now? That seems pretty reasonable.
Re:Electron 4.0.0 by ausjke on Friday December 21, 2018 @12:33PM (#18734840)
looks like kivy will be a nice choice these days, actively developed, multiple platform, decent looking
Re:Electron 4.0.0 by com2kid on Friday December 21, 2018 @01:10PM (#18735195)
> Why is it that people seem to think using a cross-platform UI toolkit like tkinter, kivy, WxWindows, etc. is like putting their hand in a toilet?

For me?

Because every API I access returns JSON, and because half those API have a JS package sitting somewhere in NPM.

Bonus, a large % also have typescript definition files laying around.

So my choice is either:

1. Deal with JSON in native, and create my own wrappers for every API out there, because next to no one publishes C/C++ libraries anymore.

2. Give in to the JS behemoth.

tl;dr ecosystem.

Re:Electron 4.0.0 by zozbot123 on Friday December 21, 2018 @02:09PM (#18735684)
> Deal with JSON in native

You have to parse it anyway, and in either case (native or JS) you'll be using a pre-built facility for that. Plenty of "native" languages can have good JSON support these days, and the "create a wrapper for the API" part is trivial if there's one available already, even if it's JS.

Re:Electron 4.0.0 by com2kid on Friday December 21, 2018 @02:39PM (#18735915)
> You have to parse it anyway

In JS you can just access the fields. With a lot of APIs just being HTTP endpoints, call fetch, get JSON, see if you like how it works.

Move over to a better NPM library that wraps it later on if so desired.

But for prototyping stuff, JSON+JS is stupid fast. JSON store DBs suck for a lot of reasons, but getting something working in them is incredibly easy.

Getting that something to "real product" is probably end to end more work than if a better tech stack was chosen. You win some and you lose some!

Re:Electron 4.0.0 by pseudalopex on Friday December 21, 2018 @04:49PM (#18736995)
Python also has lots of libraries. You can use Qt with JavaScript.
Re:Electron 4.0.0 by azeirah on Friday December 21, 2018 @12:27PM (#18734798)
Check out pyqt, it's fast, cross platform, and super full of features
Re:Electron 4.0.0 by moogly on Friday December 21, 2018 @06:40PM (#18737733)
5 words: hot code reloading feedback loop
Re:Electron 4.0.0 by mattigames on Friday December 21, 2018 @11:41AM (#18734461)
I tried to use QT with python, "I'm a big boy I can make native UI!" I said to myself... let's say I rather shoot myself than try QT ever again.
Re:Electron 4.0.0 by simion314 on Friday December 21, 2018 @12:14PM (#18734688)
For simple UI you need to understand how layout works and then use the drag and drop designer. IMO is much simpler then learning and debugging CSS issues.

If you want to create custom elements I assume is simpler to do it in html with a couple of nested divs, background images and some css rules and some trickery and most probably your custom widget is not accessible and missing some nice features. As an example I know toolkits(Qt,Flex4) that can render huge tables of data, allow customization and are very efficient and you don't need third party libraries for that.

Re:Electron 4.0.0 by mattigames on Friday December 21, 2018 @07:17PM (#18737963)
Is much easier to understand CSS than QT designer, that gigantic generator of errors and wrong previews.
Re:Electron 4.0.0 by seba_dos1 on Friday December 21, 2018 @12:10PM (#18734668)
...and I have 5 years of professional experience as a JavaScript developer, yet I strongly prefer to write desktop apps and utilities with Qt (both PyQt and C++/Qt) than Electron.
Re:Electron 4.0.0 by mattigames on Friday December 21, 2018 @07:12PM (#18737930)
You do you, I tried to make a simple list on PyQt and everything went wrong, a lot of signal issues, a lot of debugging compile issues, missing dependencies, wronly versioned dependencies despite downloading QT straigt from the site, never again going away from CSS and JS. And with flexbox and SASS is a pleasure to write CSS anyways.
Re:Electron 4.0.0 by seanalltogether on Friday December 21, 2018 @11:37AM (#18734413)
> This is mostly why I'm against electron. If electron worked like the JVM and each app shared a runtime, many issues would be solved, including many electron apps running old, and vulnerable versions of Chromium.

On the other hand, requiring a shared runtime has been one the key reasons that a lot of cross platform apps failed in the past. How many times have others decried the fact that they had to install Java or Adobe AIR or XYZ in order to run an app they needed.

Re:Electron 4.0.0 by sime2009 on Friday December 21, 2018 @03:33PM (#18736372)
Well, there was a solution to that last problem. Just bundle the whole runtime with the product each time. And just like that we're back at square one again...
Re:Electron 4.0.0 by Splines on Saturday December 22, 2018 @02:56AM (#18739533)
Steam seems to solve this fairly well. If you need a runtime it is installed along with the product.
Re:Electron 4.0.0 by Sindisil on Friday December 21, 2018 @03:19PM (#18736260)
> If electron worked like the JVM and each app shared a runtime

Unfortunately (or fortunately, depending upon your point of view), the JVM world has moved to a model of embedding a JVM with each app, as it can be less problematic for developers (and lets Oracle remove a bunch of subsystems from the JDK, reducing their development and maintenance).

On the up side, though, newer releases of Java provide jlink, so that the JRE can be stripped down to exclude subsystems that aren't used by the app. Also, several JVMs still support class data sharing, so if multiple instances of an app are launched, they can share some common class data.

Re:Electron 4.0.0 by alex_suzuki on Friday December 21, 2018 @10:55AM (#18734059)
The last point is something that in theory could have been achieved (shared runtime) with Java or .NET, but in reality there are real, tangible benefits to shipping self-contained applications, and the disk size argument is just no longer that relevant.

This is in no way an endorsement for Electron, just an aspect common to all platforms that rely on an intermediate runtime that could in principle be shared.

Re:Electron 4.0.0 by wodenokoto on Friday December 21, 2018 @11:03AM (#18734118)
Actually disk size argument is still relevant. My brand new MacBook pro has the same disk space as my 10 year old MacBook pro.

While hard drive space is cheap on spinning drives, space on consumer devices has stagnated or even decreased with the move to ssd

Re:Electron 4.0.0 by rubber_duck on Friday December 21, 2018 @11:16AM (#18734242)
We are still talking ~100MB (from what I can see my entire VS Code install folder is 170 mb - 100 probably goes off to chromium stuff) - even if you use 10 electron apps 1GB of memory isn't going to kill your drive - really not worth the tradeoff and effort considering the alternatives.
Re:Electron 4.0.0 by fredley on Friday December 21, 2018 @10:59AM (#18734085)
Disk size argument no but memory yes. Keeping this massive binary duplicated in memory for every trivially small (memory-wise) app, like Slack, is bananas.
Re:Electron 4.0.0 by realusername on Friday December 21, 2018 @10:58AM (#18734074)
> the disk size argument is just no longer that relevant.

But the memory one definitely is, I don't want each app to take 1GB of ram.

Re:Electron 4.0.0 by PavlovsCat on Friday December 21, 2018 @11:45AM (#18734492)
> there are real, tangible benefits to shipping self-contained applications

Here's one that doesn't suck:

https://sqlitestudio.pl/

Maybe that was very complicated to make, all I know is that it's blazing fast and doesn't hog memory. Or hey, take OggDrop and LameDrop, I'm sure there's programs that do the same, are 100 times as big and have 3 options. I don't know if there are 10x programmers, but I know there are 100000x programs, with not one electron app among them.

Re:Electron 4.0.0 by kimmel on Friday December 21, 2018 @04:02PM (#18736621)
I love SQLiteStudio. On my machine it starts up in < 2s. Version 3.2.1 takes 99MB disk space and is built against QT5. I just ran some queries and the memory usage is only 80MB for a not too large database.

Another self-contained application I like is racket/drracket.

Re:Electron 4.0.0 by blinkingled on Friday December 21, 2018 @11:45AM (#18734494)
> - The operating system cannot share memory between different Electron processes [..]

That should not be a significant issue in 2018 - all popular operating systems have same page merging support now and at least latest Win10/macOS also have transparent compression of memory pages.

Re:Electron 4.0.0 by ahartmetz on Friday December 21, 2018 @12:45PM (#18734962)
Compressing working memory is quite expensive in CPU cycles compared to just using it. Identical page merging is also reasonably expensive and only works if pages are, well, identical. Your Electron runtimes are probably not going to be bit for bit identical, not even small sections, due to offsets not divisible by page size. Tuning for better deduplication is possible, but then you're at an awkward mix of caring and not caring about performance.
Re:Electron 4.0.0 by blinkingled on Friday December 21, 2018 @03:23PM (#18736297)
Compression is pretty fast on modern CPUs so I would disagree about that. But yes depending on the compiler/switches/versions the Electron run times are not going to be bit for bit identical but it's a stretch to say there will be nothing in common - all the dependent library code for e.g.
Re:Electron 4.0.0 by ryacko on Friday December 21, 2018 @12:40PM (#18734918)
Woudldn’t that break ASLR?
Re:Electron 4.0.0 by blinkingled on Friday December 21, 2018 @03:54PM (#18736558)
ASLR applies to virtual memory / process address space. Merging or compression is of physical pages - the page is uncompressed on the fly when the process accesses it. It works because the OS is in control of the Virtual->Physical mappings and can, on a page fault do the decompression transparently for e.g.
Re:Electron 4.0.0 by Aaronmacaron on Friday December 21, 2018 @11:52AM (#18734552)
I don't think a JVM like chromium engine would really solve the problem. Most JVM end user applications ship their own JVM. By shipping your own JVM one can avoid compatibility problems and most importantly the user doesn't has to install the JVM which makes for better UX. The same would apply for Electron.

The only way I think a common runtime could work is if Electron used the Runtime of the Browser. If every browser exposed an API to run JavaScript and Render HTMl using the browser's Engine that'd be great.

Re:Electron 4.0.0 by vincnetas on Friday December 21, 2018 @12:11PM (#18734675)
Adding to my previous comment, you can even run chrome webpage without address bar on macos : /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --app=https://google.com
Re:Electron 4.0.0 by vincnetas on Friday December 21, 2018 @12:07PM (#18734650)
Why expose api. One could run web server on localhost and thats it. Open it with any browser and enjoy your crosplatform app. I think https://blockstack.org is doing something similar.
Re:Electron 4.0.0 by felixfbecker on Friday December 21, 2018 @11:34AM (#18734374)
When I tried out Windows tabbed shell in the Insiders build I found myself using the web versions of Electron apps (e.g. Slack) way more than the apps. They can do everything the app can nowadays (including native notifications), and with tabbed shell, they can appear next in a tab right next to a native app - but with all the benefits of web apps: linkability, hackability through browser extensions, accessibility, no annoying update prompts. And of course only running one browser engine instance. You can even pin them to your task bar like native apps. I feel like on macOS many people install native apps only to have a dock icon. We really overvalue packaged apps
Re:Electron 4.0.0 by drb91 on Friday December 21, 2018 @11:45AM (#18734491)
> We really overvalue packaged apps

I think splitting out services from the browser makes it easier to focus on notifications and use window management to change contexts. It is confusing and frustrating that Apple has not allowed saving websites to apps yet.

Re:Electron 4.0.0 by ancorevard on Friday December 21, 2018 @11:21AM (#18734282)
The root cause of the problem with Electron is that its performance on the Mac is just like the Chrome browser.

Compared to Safari, Chrome’s performance is like a fat pig hogging your memory and devouring your battery life.

Re:Electron 4.0.0 by jf- on Friday December 21, 2018 @11:13AM (#18734212)
Is there a reason it’s not done as a runtime, i.e. have a single, electron-modified, backwards compatible install of chromium which all the electron apps run on? Then ship each app with the installer for that electron-chromium which gets installed if it’s not already present.

Though I feel like even if that happened people would still complain about it, mostly motivated by web technologies encroaching on the desktop space, threatening other developers “turf”, so to speak.

Re:Electron 4.0.0 by megous on Friday December 21, 2018 @11:39AM (#18734437)
No there isn't. For example on Arch Linux, you can do pacman -S electron and share the same runtime for all your electron apps. Though, I don't use any third party ones.
Re:Electron 4.0.0 by jf- on Friday December 21, 2018 @12:02PM (#18734614)
That’s interesting. Is there something specific to arch that allows this? It would definitely help to alleviate people’s concerns about electron if this could be replicated on other platforms.
Re:Electron 4.0.0 by megous on Friday December 21, 2018 @05:47PM (#18737394)
Nothing specific. You can do it with electron executables downloaded from the official website.

Just run them, and drag'n'drop directories with the application's source code onto the electron window, or create desktop shortcuts that run "C:\somewhere\electron.exe C:\your\app\dir".

Re:Electron 4.0.0 by simion314 on Friday December 21, 2018 @12:18PM (#18734726)
This would work only for packaged apps from the repos right?

Better then nothing.

Re:Electron 4.0.0 by megous on Friday December 21, 2018 @05:42PM (#18737359)
I didn't find any apps in the repository. This works for apps you write yourself. You just run "electron ." in the directory with the app's source code.

You can probably unbundle thirdparty apps, becuase what electron apps are, are basically "electron" + "other code/resources". But I've never even seen someone else's electron app distribution package, so I don't know how hard/easy it would be. And I wouldn't trust it anyway, if the code is transpiled/minified/unreadable.

I run all my electron apps using a shared runtime.

Re:Electron 4.0.0 by simion314 on Saturday December 22, 2018 @03:10AM (#18739579)
Thanks for the response, then we need to ask developers to offer a download option without electron, If I remember right when I download Intellij products there is an option to download with or without a bundled Java.
Re:Electron 4.0.0 by megous on Sunday December 23, 2018 @12:28PM (#18747202)
Developers would not probably like it, because they would have to care for backwards compatibility and more uncertainty.
Re:Electron 4.0.0 by manigandham on Friday December 21, 2018 @01:20PM (#18735294)
Why does this matter on any modern operation system and hardware? What is the point of unused RAM capacity given fast mem/disk IO, compression and seamless paging?
Re:Electron 4.0.0 by zozbot123 on Friday December 21, 2018 @06:48PM (#18737781)
Disk IO is not always fast. Memory bandwidth is a huge bottleneck on current-day systems, especially on high-frequency, high-core-count processors. And so on and so forth. If you want a snappy and truly usable system you still need to care about performance issues, particularly given the rise in non-reducible system requirements e.g. for browsing the modern web.
Re:Electron 4.0.0 by SigmundA on Friday December 21, 2018 @11:34AM (#18734379)
Wouldn't memory compression and disk compression resolve those issues to some degree?

Sharing libraries is definitely more efficient but at the cost of isolation and versioning issues. Similar to some of the reason vms and containers are used.

Over time I have come to appreciate self contained apps and deal with redundant bytes at a lower level.

Re:Electron 4.0.0 by jackpeterfletch on Friday December 21, 2018 @11:39AM (#18734436)
- If electron worked like the JVM and each app shared a runtime

You mean like eerr, chrome - and the web :P

Re:Electron 4.0.0 by CyberDildonics on Friday December 21, 2018 @11:01AM (#18734101)
The biggest issue by far with every electron based program I've used is actually not the huge memory foot use or the hundreds of megabytes for a simple program, it is the latency of the interface.

Every interaction ends up lagging like molasses, whether it is text input, window resizing, startup time etc.

We have video games that run 3D environments with gigabytes of geometry and textures at 144hz yet people are making simple text editors and interfaces with a dozen simple components (like the ethereum wallet) that run xwindows streamed over a 56.6 modem.

Re:Electron 4.0.0 by jeffbax on Friday December 21, 2018 @11:56AM (#18734574)
Nevermind the small but incredibly obvious stuff like keyboard shortcuts, drag and drop behavior and text selection…
Re:Electron 4.0.0 by spiralganglion on Friday December 21, 2018 @12:26PM (#18734784)
I think this is an excellent criticism of Electron that seems to be buried. Sure, it’d be nice if the RAM usage and disk footprint of electron were smaller. Maybe the creation of some sort of shared single instance of chromium will happen, someday. But even if it does, the browser rendering process is really latent unless you’re extraordinarily careful. It’s very challenging to make sure that your app responds to input within one frame — batching updates with requestAnimationFrame creates a visible delay when dragging and typing. It’s possible to do better, but it’s hard and almost nobody does. And it’s easy to do a lot worse — RAIL isn’t aggressive enough.

(My angle on this — I do high-performance 2d/3d animation work in the browser and in electron, with extensive testing of latency, energy usage, frame rate stability, etc)

Re:Electron 4.0.0 by ahartmetz on Friday December 21, 2018 @12:54PM (#18735034)
I've heard a similar story about an app implemented in HTML5 and node.js (no good JS UI frameworks existed at the time). The fine-tuning took an extraordinary amount of time. I was on a project that redid it in QML in a fraction of the time with a fraction of the headcount and performance was great right away.
Re:Electron 4.0.0 by fabiospampinato on Friday December 21, 2018 @11:18AM (#18734258)
Performance improves as each new version of Electron basically ships with an updated V8 engine, which usually improves performance, but they also work on optimizing Electron itself (for instance: [1]).

I think most of the times if an Electron app is not snappy enough then the developers didn't spend enough time optimizing it, take a look at VS Code vs Atom for instance, I haven't used Atom in a while so maybe the situation in different now, but both are Electron apps, VS Code is fast and Atom is (was?) not.

[1] https://github.com/electron/electron/pull/14633

Re:Electron 4.0.0 by InGodsName on Friday December 21, 2018 @11:44AM (#18734488)
I think it's because VSCode uses typescript and it had better plugin architecture.

VSCode also uses lazy loading so doesn't initate everything at once you click the launcher icon but does it progressively.

Re:Electron 4.0.0 by fabiospampinato on Friday December 21, 2018 @11:55AM (#18734567)
VS Code doesn't provide direct DOM access to extensions authors, that's definitely a deciding factor.

But a couple of years ago even simply writing inside Atom without using any extension felt sluggish to me.

TypeScript gets downcompiled to JavaScript anyway, so I don't think that's directly a contributing factor, but maybe because of the type system they can spend less time debugging and more time optimizing.

Re:Electron 4.0.0 by bitwize on Friday December 21, 2018 @12:55PM (#18735040)
It's because much of the guts of VSCode is written in C++ and optimized.

Because, you know, Microsoft.

Re:Electron 4.0.0 by sime2009 on Friday December 21, 2018 @03:35PM (#18736395)
No it's not.

The file searching code is in Rust (IIRC) and runs as an external process, but that is about it.

Re:Electron 4.0.0 by InGodsName on Friday December 21, 2018 @01:31PM (#18735376)
So eletrons lets you code part of it in C++?
Re:Electron 4.0.0 by fabiospampinato on Friday December 21, 2018 @02:06PM (#18735664)
You can have native modules in Node.js, and you can use Node.js inside Electron.
Re:Electron 4.0.0 by simion314 on Friday December 21, 2018 @12:06PM (#18734642)
>Does the Electron team have a focus on improving performance? Or is the issue with the developers using electron, should they be optimizing better?

I think the main issue is the developers, some apps don't use so much memory where others seem to use too much for the features they provide, IMO most JS developers do not understand how GC works and how you can by mistake keep objects alive.

There is also the issue where you do not have a default UI toolkit and some frameworks like angular are bad for performance(I mean how in angular codes I seen data binding trigger tons of unnecessary updates but maybe some will blame the developers using it wrong)

Re:Electron 4.0.0 by tschellenbach on Friday December 21, 2018 @12:02PM (#18734616)
Lately Atom is running quickly for me, but Goland is very slow and resource intensive. So I guess it varies, but Electron starts at a disadvantage.
Re:Electron 4.0.0 by sergiotapia on Friday December 21, 2018 @10:56AM (#18734068)
Either they start working towards performance/memory issues or this will very likely go the way of Cordova/PhoneGap. Feature rich, but ultimately forgotten and not used for new projects.
Re:Electron 4.0.0 by NatW on Friday December 21, 2018 @11:03AM (#18734122)
I don't think VSCode is going away. It's built on Electron[1] and performs quite adequately for me, personally.

[1] https://en.wikipedia.org/wiki/Visual_Studio_Code

Re:Electron 4.0.0 by intertextuality on Friday December 21, 2018 @11:06AM (#18734149)
VSCode seems to be one of the exceptions. It's also not as fast as Sublime Text.
Re:Electron 4.0.0 by 0xCMP on Friday December 21, 2018 @11:21AM (#18734278)
Agree, but because it's JS and well designed plugins also affect the editor experience much less. Where in Sublime the Python based plugins which aren't designed around async and promise-like patterns often can lock up the editor waiting on them.

VSCode is pretty much the best Emacs there is right now. Uses JS, has good package management, allows changing settings per "workspace" including enable/disable plugins, has great git support, pioneered LSP, and more.

I literally want to hate VSCode, but there isn't much to hate and any weakness it has can/should/likely-will be addressed by a plugin.

Re:Electron 4.0.0 by GuB-42 on Friday December 21, 2018 @12:00PM (#18734592)
Performance is the reason why I stayed with Sublime Text. I gave VSCode a try, and it is really great, and transition from Sublime Text is easy. They probably stole most of their good ideas from it, while improving on others, a practice that I definitely support.

However, it is not as responsive. By that, I mean sub-second stutters, nothing game breaking, but enough to affect the feel.

Note: coding in C++, using the LSP plugin on Sublime, and the standard language support on VSCode. Building and source control done separately on the command line. I use "modific" on sublime to see the differences, and the built-in support for VSCode.

Re:Electron 4.0.0 by nni on Friday December 21, 2018 @11:05AM (#18734139)
I've only very rarely seen performance issues with VSCode...