TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

M1 MBP down to 3.5hr battery life when writing code

54 pointsby johanamover 2 years ago

24 comments

mrtksnover 2 years ago
According to the OP, the culprit is VSCode: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;brian_lovin&#x2F;status&#x2F;1628505684504625152" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;brian_lovin&#x2F;status&#x2F;1628505684504625152</a><p>On my 1 y&#x2F;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&#x27;s still lighter than some web dev stuff.
评论 #34914271 未加载
评论 #34914095 未加载
评论 #34913864 未加载
评论 #34914025 未加载
评论 #34914019 未加载
评论 #34913878 未加载
评论 #34914031 未加载
elliottkemberover 2 years ago
<a href="https:&#x2F;&#x2F;code.visualstudio.com&#x2F;blogs&#x2F;2021&#x2F;02&#x2F;16&#x2F;extension-bisect" rel="nofollow">https:&#x2F;&#x2F;code.visualstudio.com&#x2F;blogs&#x2F;2021&#x2F;02&#x2F;16&#x2F;extension-bis...</a><p>Please, if you use VSCode, use this bisect tool! Use this to bisect your extensions and figure out what&#x27;s using too much CPU. I did this and it made a HUGE difference. Highly recommended.
ArchOversightover 2 years ago
My M1 MBP hasn&#x27;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 &quot;helper&quot; 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.
评论 #34918912 未加载
评论 #34914819 未加载
brarsanmolover 2 years ago
I know right now it&#x27;s all anecdata but I noticed this as well! My 2020 M1 Mac&#x27;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&#x27;s.<p>Although this could just be my fault as I&#x27;ve already racked up close to 600 cycles on a machine that has only gotten a year and a half&#x27;s worth of use.
评论 #34913388 未加载
评论 #34913778 未加载
评论 #34918946 未加载
klooneyover 2 years ago
My m1 is employer provided, so I always just blame the 10 different security&#x2F;management tools.
评论 #34913983 未加载
ChrisMarshallNYover 2 years ago
Depends on what apps he&#x27;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.
评论 #34913764 未加载
评论 #34913668 未加载
评论 #34913669 未加载
bonney_ioover 2 years ago
My anecdata: M1 MacBook Air, and I haven&#x27;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&#x27;ve found myself impressed with VS Code&#x27;s efficiency and performance as an Electron app, especially versus Discord (gross) or Teams (awful).
zora_goronover 2 years ago
I was having similar battery life on my 2020 Intel MBP, and I found turning off the &quot;Manage battery longevity (As your battery ages, maximum capacity is reduced to extend battery lifespan.)&quot; setting improved battery life by an additional few hours.
cramjabsynover 2 years ago
An accidental advertisement for vim
评论 #34914066 未加载
评论 #34914672 未加载
bobleeswaggerover 2 years ago
I&#x27;m moving to a Mac Mini and an iPad Pro. More expensive? Maybe. I just don&#x27;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.
ilrwbwrkhvover 2 years ago
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.
buffingtonover 2 years ago
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&#x27;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.
TMWNNover 2 years ago
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&#x27;d expected. I don&#x27;t do anything heavy on the computer—browser, Discord (which I know is Electron), Excel, and ssh—and the M1&#x27;s battery only lasts for about six hours. Can using Chrome as the browser and not Safari make that much of a difference?
评论 #34920183 未加载
ravagatabout 2 years ago
Yeah the culprit is largely VSCode and electron&#x2F;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&#x27;t always have build systems on especially Docker and similar VMs
999900000999over 2 years ago
Running Unity my M1 Air only gets like 3 hours.<p>Edit: I&#x27;m using VS Code as my IDE which seems to be the actual issue.
jdlygaover 2 years ago
3.5 hours is still pretty good. Every Dell I&#x27;ve ever had for work is 1.5 hours tops.
评论 #34913713 未加载
invalidnameover 2 years ago
I work for many hours with IntelliJ&#x2F;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.
kayodelycaonover 2 years ago
In absence of other data, I’d check if it’s a VSCode plugin&#x2F;extension. Or a hung process that’s not showing up in the energy tab.
peterhartreeover 2 years ago
I have same issue with my 2021 16&quot; M1.<p>I bought an iPad Pro recently, so I can leave the 16&quot; plugged in at the office.
migaover 2 years ago
When coding, you usually will have linter or compiler taking 100% core in the background.
silisiliover 2 years ago
Does Mac not have stats for who used what? Does iOS? Even something like powertop?<p>I&#x27;m from the Android world, and that&#x27;s one feature that -really- helps identify problems, instead of making an overly vague post like this.<p>Really surprised every platform doesn&#x27;t have something like that by now...
评论 #34913802 未加载
评论 #34913776 未加载
geodelover 2 years ago
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.
评论 #34914218 未加载
drcongoover 2 years ago
Absolutely certain that he&#x27;s using VSCode.
评论 #34913766 未加载
birdyroosterover 2 years ago
It&#x27;s manufacturer defect, that&#x27;s too little for such a young machine. Mine is same age and lasts over 10hrs every time.
评论 #34913900 未加载