6 ms·
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 th
by scoopdewoop 8y ago
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.
- zozbot123 8y ago> 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?
- seba_dos1 8y agoNot commenting on anything else, but Discord app consuming 180MB RAM sounds like a mismeasurement. Here it takes almost 0.5GB right after launching.
- mbell 8y agoThey 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.
- pseudalopex 8y ago400 MB is enough to run Mail and Messages with room to spare.
- burgerboy 8y agoAnd literally no one cares about a few hundred mb of ram
- deleted 8y ago[deleted]
- M4v3R 8y agoIt 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?
- scoopdewoop 8y agoCould 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
- com2kid 8y agoThe 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.
- exitcode00 8y agoExactly, 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
- ksec 8y agoOn the other hand WhatsApp on Mac is using up to 1GB of RAM and doing abosutely nothing.
- zimpenfish 8y agoOn 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!)
- ksec 8y agoI 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 )
- ksec 8y ago5 Hours later, 250MB + 250MB + 90MB. That is 590MB, so may be it wasn't as good as I thought.
- ksec 8y agoAnd 24 hours later, All WhatsApp Added up to 1.2GB. So your figures were completely wrong.
- zimpenfish 8y agoNo, 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.
- PieUser 8y agoIt'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.
- fabiospampinato 8y agoWell that doesn't tell me much about Electron, the latest Visual Studio Code for macOS that I just downloaded weighs less than 200MB.
- JensRex 8y agoA 200 MB text editor, no matter how fancy, is also insane.
- codezero 8y agoIs 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.
- toyg 8y agoThe 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.
- codezero 8y agoI’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 :)
- burtonator 8y agoI'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/ 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.
- rrosen326 8y ago[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.
- burtonator 8y agopdf.js... it works just fine ;)
- dreix 8y agoIt 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.
- tomc1985 8y ago> 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....
- JetSpiegel 8y ago> Who are all these masochists using Tkinter? embarassed hand raise It's not that bad, just pretty bad.
- exitcode00 8y agoIt 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 https://medium.com/commitlog/electron-is-cancer-b066108e6c32
- sime2009 8y agoMaybe 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.
- exitcode00 8y agoOk, 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
- tinco 8y agoWhat universe do you live in where unreal engine launches in less than 30 seconds?
- AnIdiotOnTheNet 8y agoThey 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.
- orf 8y agoYeah, 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.
- accatyyc 8y agoTelegram 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.
- solarkraft 8y agoTelegram 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.
- Klonoar 8y agoThese 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.
- chipotle_coyote 8y agoHow 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.
- jf- 8y ago> 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.
- Ari_Ugwu 8y agoI 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_.
- plorkyeran 8y agoI 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.
- pseudalopex 8y agoElectron seems to use less memory on Windows. Also, Discord seems to be more efficient than other Electron chat apps.
- solarkraft 8y ago180MB 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.