3 ms·
Is your mail client always in focus? Because unless this is the case analogy with vs code is not correct, when it loses focus it stops rendering the cursor.
by iaml 10y ago
Is your mail client always in focus? Because unless this is the case analogy with vs code is not correct, when it loses focus it stops rendering the cursor.
- tonyarkles 10y agoThese are the kinds of things that I don't want to even have to think about. The cursor is an example, not an analogy. To indulge this though, I'm just looking at my cumulative CPU time list on this Mac Mini (not a laptop, so I don't care so much about battery draining and I tend to keep things open and forget about them). TogglDesktop has used 1h27m of CPU time since I launched it. That's, I'm 99% sure, an Electron app. It's a single window that displays a timer and sends the occasional POST request back to the Toggl servers. Spotify is at 1h23, but at least it's doing a bunch of audio decoding in the background. Slack has used 56m of CPU time as well. I'm a little disturbed to see that Excel has used over 22h, and I've barely used it, but forgot that it was open. Closing that now. As a decent contrast, I used Remote Desktop for approximately 32hr/wk, and it's sitting at 4h51. That is streaming compressed images/video constantly as it runs.
- iaml 10y agoYou can make an app that runs like shit with any technology possible, it's not the fault of technology itself. I mean, in the article author was suggesting an option of redrawing the whole window at 60 fps which is also not very efficient and also not electron.
- tonyarkles 10y agoSure... but when you choose Electron, you're starting off with a 200MB footprint before you've even done anything. And there's so many gotchas, where doing something seemingly innocent causes poor performance (e.g. what the VS Code guys did was totally reasonable, but the underlying Chromium engine did something stupid) I get that there's a lot of things that Electron makes really nice for doing app development, but there's a tradeoff there: how good is it going to be for development vs. how well is it going to perform? And in a lot of cases, it'll perform just fine. Not nearly as good as the same approach would in an actual native framework, but good enough and with a lot less work. Re: the 60fps thing, that's exactly what happened in the VS Code example, except it was triggered by CSS. They weren't trying to redraw the window at 60fps, but they were because of a simple chunk of CSS that should have only caused the cursor to change every second. Anyway, I'm totally speaking from my own experience here, and I agree that it's possible to make software that runs like shit in any language, but every Electron app that I use does run like shit. And these aren't little one-off things, these are apps built by established companies. Toggl is a frickin' timer. How is it possible to make a timer app that is slow to show a pop-up?! The other question is: if they all have shitty performance, why do I use them? And the answer is: because they're useful. I tolerate them because despite the frustration every day, I still find utility there (and I'm working on a desktop where battery life isn't a concern). If you've got a good example of an Electron app that doesn't perform poorly compared to an equivalently-designed native app, I'd love to see it! And it'd be awesome if the author of that app could start sharing their techniques, so that all of these well-established companies using Electron could stop making their apps suck at being responsive.