According to the OP, the culprit is VSCode: <a href="https://twitter.com/brian_lovin/status/1628505684504625152" rel="nofollow">https://twitter.com/brian_lovin/status/1628505684504625152</a><p>On my 1 y/o M1 Air I consistently get over 10hrs mixed use. Coding itself is not compute intensive at all but someone is using some build systems, VMs. Docker etc. these things constantly compute stuff and as a result the battery is decimated.<p>The modern Dev environments are ridiculous, no matter what people say coding Swift on XCode is a breeze. Even if you do dynamic previews with SwiftUI and use simulators, it's still lighter than some web dev stuff.
<a href="https://code.visualstudio.com/blogs/2021/02/16/extension-bisect" rel="nofollow">https://code.visualstudio.com/blogs/2021/02/16/extension-bis...</a><p>Please, if you use VSCode, use this bisect tool! Use this to bisect your extensions and figure out what's using too much CPU. I did this and it made a HUGE difference. Highly recommended.
My M1 MBP hasn't been able to last over 4 hours since I got it... but for work I have to use Slack and Teams.<p>If I am on a video call with Teams I am lucky if I get 1.5 hours out of a 100% filled battery, as the Teams "helper" sits at 190% CPU usage during the entire call.<p>Electron applications are wasting so much CPU time and power.<p>My personal M1 MBP that I got when it was first released still lasts over 10 hours. I code in VimR with Rust analyzer and compile Rust projects for hours on end. No issues.<p>Just, no Electron applications and stuff sips battery.
I know right now it's all anecdata but I noticed this as well! My 2020 M1 Mac's battery life has significantly decreased as well, to the point where I need to charge twice a day like I used to for the old Intel Mac's.<p>Although this could just be my fault as I've already racked up close to 600 cycles on a machine that has only gotten a year and a half's worth of use.
Depends on what apps he's running. I suspect Xcode is pretty optimized (but buggy as all git-go -I should know. I use it all day), but Slack and VSCode are electron apps, and Electron is notorious for eating power.
My anecdata: M1 MacBook Air, and I haven't noticed such a drastic difference in battery life in a day in Xcode vs. a day in Visual Studio Code. However, I run a very lean install of VS Code, plugin-wise, which certainly helps.<p>Overall I've found myself impressed with VS Code's efficiency and performance as an Electron app, especially versus Discord (gross) or Teams (awful).
I was having similar battery life on my 2020 Intel MBP, and I found turning off the "Manage battery longevity (As your battery ages, maximum capacity is reduced to extend battery lifespan.)" setting improved battery life by an additional few hours.
I'm moving to a Mac Mini and an iPad Pro. More expensive? Maybe. I just don't need to carry around an extra keyboard, screen, and battery that could go bad. Tablets are so good these days that laptops make little sense IMO.
And that is why developers should shun Electron apps. The fact that every developer uses them is shameful. We should have more self respect to not use memory hogs and inefficient programs.
My work machine is an M1 Pro, and there are days where I forget to plug it in and I still have maybe 33% capacity left at the end of the day.<p>I'm typically in VSCode, XCode, Slack, and Zoom, and have more Chrome tabs open than physics allows. Lots of software building, even the occasional AI image generating sessions, and the battery just keeps on keeping on.<p>Prior to this machine, my Intel MBP would have melted into a puddle after using its entire battery in 20 minutes.
I got a 2021 M1 MacBook Pro a few months ago. Battery life is better than on my previous 2012 MacBook Pro, but not as good as I'd expected. I don't do anything heavy on the computer—browser, Discord (which I know is Electron), Excel, and ssh—and the M1's battery only lasts for about six hours. Can using Chrome as the browser and not Safari make that much of a difference?
Yeah the culprit is largely VSCode and electron/chromium apps. This why I personally switched into native apps for my dev work. Currently using Sublime Text and as much as possible I use tools like a site specific browser tool, Unite 4 to lower reliance on electron apps. Also I don't always have build systems on especially Docker and similar VMs
I work for many hours with IntelliJ/IDEA. 4 open browsers with 100+ tabs in total. Presentation and video software. The works.<p>Docker will sabotage performance and battery life.<p>The worst are x86 processes. Make sure to have only ARM processes.
Does Mac not have stats for who used what? Does iOS? Even something like powertop?<p>I'm from the Android world, and that's one feature that -really- helps identify problems, instead of making an overly vague post like this.<p>Really surprised every platform doesn't have something like that by now...
Seems Electron for the win. I think upgrading to M2 MBP will help a bit until M3 pro is out. Lets be honest M1 MBP is dinosaur when it comes to modern dev tools like Slack or VSCode etc.