3 ms·
If I look at the top 10 CPU used time items for me, with an uptime of 14 days, it's 6 vscode processes and 4 macos processes (I count 15 other vscode processes
by jemmyw 3y ago
If I look at the top 10 CPU used time items for me, with an uptime of 14 days, it's 6 vscode processes and 4 macos processes (I count 15 other vscode processes in the whole list which seems insane!)
Calculating battery usage is pretty hard, I can only go by the observation that I have 2 vscode projects. One is a rails app and vscode doesn't do a heap of stuff for ruby code, battery drops very slowly. The other is a typescript project and when I work on that my laptop steams through the battery, and I know its vscode because I see its usage go up as I edit files. It's not insignificant.
As I said, vscode gives me a lot in return for this. It has 2 windows open. I've got 10 terminal windows open and kitty has 1 process. That is a program with actually negligible impact on battery life, lag, memory usage etc. If every program is electron then the problem compounds.
- jauntywundrkind 3y agoTop 10 on my MacBook is usually still gaspingly tiny utilization; it means almost nothing. I feel like we are back where I started: I doubt your vscode would be significantly different than my neovim. That's been my experience. I definitely lose some power keeping tsc watch running and having LSP update itself. And having projects reload. But these aren't fault of vscode - these all run when I'm using neovim too. Amid these processes vscode seems unimportant. If it is a drain, evaluate your plugins & find who is the problem. I already explained why having multiple electron apps likely doesn't compound the problem: you're only one user. It's very infrequent that you'll be heavily using multiple apps. Even if you are, the likelihood is that the resource usage is being spent on real work, doing heavy transportation or type checking or whatever it is pumping data at your console. There's a significant chance that worrying about the cpu usage of the gui is pointless & irrelevant by comparison.
- jemmyw 3y agoIt is vscode's built in typescript lsp as far as I can tell. I'm not sure what you're arguing at this point. I use vscode, its fine, it has a lot of gui and I'm happy with it. I don't mind its electron. It uses a lot more resources than my terminal. It has a non-negligible affect on the battery life. As do the 2 chromium based browsers I use and slack. This is about features vs resources. Vscode, lots of gui, extensions, tons of features, I think the tradeoff is fine. Browsers, even more flexible interface, the tradeoff is OK. Slack - not ok, I do not feel it offers enough for the resources and sluggishness it uses. How many times have I had to kill a runaway slack or browser process? Too many. It's very irritating to realize your battery has been drained because of one of these things. Now you seem to be blaming the authors of these programs because not every electron based program has this kind of issue (actually if I think back I think vscode is the only one that has never had a repeating runaway process problem that I've used on a regular basis). My argument is that it seems to happen often enough that its something inherent to electron apps. I don't want another common application in electron, one that really doesn't need the benefits that electron provides. The terminal is one. IMO text chat is another. Edit: I had to go out before I could edit this unintelligible mess. Bottom line, I'm not anti electron. It has benefits. But there are real tangible downsides too and I've experienced those downsides. I think it's not the right tool for a terminal program or a chat program. It makes sense for a rich dynamic ui where the kind of layouts a browser engine is capable of is beyond the complexity of native widgets.