8 ms·
M1 MBP down to 3.5hr battery life when writing code
- brarsanmol 4y agoI 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. 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.
- Kon-Peki 4y agoWow, that's a lot of cycles! Mine is 11 months old and has 46. I use it mostly plugged in with a second monitor, but I just recently took a trip and never charged it, even though I wrote 2/3 of a new app in Xcode.
- brarsanmol 4y agoHaha yeah! It's nice to see that other's machines are fairing up well. I'm a student so my machine gets a fair bit of wear and tear and theres just not much I can do about that unfortunately.
- turtlebits 4y agoFor another data point, my Dec 2020 M1 Air (which I daily drive) has 195 cycles.
- dfawcus 4y agoHow nice, my late 2010 MBA has 103, and is still on 89% health.
- buffington 4y agoMore anecdata: 175 cycles here, 99% max capacity.
- klooney 4y agoMy m1 is employer provided, so I always just blame the 10 different security/management tools.
- tecleandor 4y agoAh, that's terrible. They just took away my Lenovo laptop with Linux to set me up with a 'platformed' Intel MacBook Pro, and CrowdStrike is eating CPU all the time. Everything not included in the system (I guess CrowdStrike is checking every executable all the time) super slow. Even doing 'exa -l --icons /' on the shell is sometimes even orders of magnitude slower than my Linux. Around 50ms in Linux, but around 300ms in macOS... I thinking about setting up everything inside a virtual machine to see if CrowdStrike controls that. It might even be faster.
- klooney 4y agoIs there good virtualization software for m1 yet? Last time I looked it was like "well there's a parallels beta..."
- tecleandor 4y agoHaven't worked much on it, as I have an Intel, but I'd say the best two options you have now are Lima and UTM: https://github.com/lima-vm/lima https://github.com/lima-vm/lima https://mac.getutm.app/ https://mac.getutm.app/ I checked Virtualbox this week and it's also beta/testing for M1
- kcartlidge 4y agoParallels running ARM Windows (and Linux obvs) is now very good. And if it is Windows you're using, then Microsoft announced (last week?) that it is now a supported platform. I've used VS2022 (ARM version) with ARM Windows 11 on an 8GB M1 Air, and it's faster than my work 10th Gen i7. Obviously if you use X86 and AMD64 stuff in that configuration it's running emulated by ARM Windows, but for most non-dev stuff I use native Mac versions anyway and Parallels gives me Windows 11 either full-screen or as seamless windowed apps. It's impressive.
- zora_goron 4y agoI 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.
- 999900000999 4y agoRunning Unity my M1 Air only gets like 3 hours. Edit: I'm using VS Code as my IDE which seems to be the actual issue.
- jdlyga 4y ago3.5 hours is still pretty good. Every Dell I've ever had for work is 1.5 hours tops.
- jandrese 4y agoYour work is skimping on the battery. My work machine (a Precision 7550) easily runs all work day on battery, even with horrible battery hogs like Microsoft Teams running. One thing to watch out for: Sometimes the audio driver starts busywaiting after you wake from suspend if you have been using bluetooth. You have to manually kill it in the task manager or it will drain your battery in an hour. You can tell when it happens because the laptop gets hot and the fan starts spinning even though you're not pushing it at all.
- DrThunder 4y agoThat thing is a chonky boy though. My XPS is absolutely absymal with battery life and the Latitudes I had previously were no better.
- peterhartree 4y agoI have same issue with my 2021 16" M1. I bought an iPad Pro recently, so I can leave the 16" plugged in at the office.
- ChrisMarshallNY 4y agoDepends 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.
- fathyb 4y agoFor me Xcode uses a huge amount of power compared to VSCode with the C++ extension, making it barely usable.
- wahnfrieden 4y agoXcode eats power.
- ChrisMarshallNY 4y agoI'll take your word for it. Most of my time is spent on a tethered machine. I also suspect that it depends on what is being done. I'll bet that some types of languages compile hot, while others, cool. UPDATE: I just ran Xcode, doing my basic daily tasks (editing and building), using Activity Monitor, and it was pretty mild. It had a HUGE spike, as it started up, then dropped into single- and double-digits, after that.
- kitsunesoba 4y agoI wonder if it depends on the codebase in question. I've not had too much trouble with Xcode being power hungry on moderately-sized codebases that are entirely or almost entirely idiomatic Swift with Swift Package Manager handling dependencies. I could see this being different for a project that's a mix of Swift, Objective-C, C++, etc though or has a lot of messier Swift code of the sort that makes SourceKit grumpy (deeply nested blocks, etc).
- wahnfrieden 4y agoMostly Swift, all SPM
- fxtentacle 4y ago
- deleted 4y ago[deleted]
- birdyrooster 4y agoIt's manufacturer defect, that's too little for such a young machine. Mine is same age and lasts over 10hrs every time.
- ArchOversight 4y agoNo, it's shitty Electron apps burning through CPU cycles when just sitting there doing absolutely nothing.
- birdyrooster 4y agoI use the same electron apps, so it’s weird they are having this problem.
- drcongo 4y agoAbsolutely certain that he's using VSCode.
- deleted 4y ago[deleted]
- bobleeswagger 4y agoI'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.
- silisili 4y agoDoes Mac not have stats for who used what? Does iOS? Even something like powertop? 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. Really surprised every platform doesn't have something like that by now...
- pram 4y agoYes, activity monitor has an energy tab.
- silisili 4y agoThanks, guess I should have read more before I commented. He shows a screenshot of it if you expand replies a couple times, and yep... vscode.
- deleted 4y ago[deleted]
- daydream 4y agoThere's also the powermetrics command line tool. It shows much more than activity monitor. If activity monitor doesn't give you what you need, try it. man powermetrics.
- Kon-Peki 4y agoWas planning to write that. Additionally, powermetrics allows you to capture data to a file in either xml or plain text for logging or analysis.
- jrmg 4y agoHe posts that later: https://twitter.com/brian_lovin/status/1628505684504625152 https://twitter.com/brian_lovin/status/1628505684504625152
- mrtksn 4y agoAccording to the OP, the culprit is VSCode: https://twitter.com/brian_lovin/status/1628505684504625152 https://twitter.com/brian_lovin/status/1628505684504625152 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. 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.
- Hamuko 4y agoMy first guess would've been a JetBrains IDE. I don't personally use one but my coworkers are constantly complaining about battery drain.
- jareklupinski 4y agoI keep forgetting to turn off the django dev server launched by PyCharm until I notice that my battery is dropping
- DrBazza 4y agoExcept I run CLion for 8 hrs a day on my newish MBP M1Pro and generally end the day with 20-30% charge left. Maybe I'm not thrashing it hard enough.
- 999900000999 4y agoAny good alternatives for C#, or anyway to make VS Code less draining
- hprotagonist 4y agoRider? https://www.jetbrains.com/rider/ https://www.jetbrains.com/rider/ edit: https://github.com/OmniSharp https://github.com/OmniSharp exists, and is LSP-ish, but I have never used it.
- cramjabsyn 4y agoAn accidental advertisement for vim
- nicolaslem 4y agoI develop in Python with (neo)vim and pyright as LSP client. Pyright often has regressions where it will consume 100% of one core for about a minute after every key press. The bug usually goes away with the next update... to reappear a few weeks later. Editors are pretty efficient, linters on the other hand not so much.
- elteto 4y agoWas thinking the same… although Vim plugins are a crapshoot regarding efficiency. Seems like sometimes there’s just no winning move: either you have nice tools and no battery life, or long battery life but subpar tooling.
- kayodelycaon 4y agoIn absence of other data, I’d check if it’s a VSCode plugin/extension. Or a hung process that’s not showing up in the energy tab.
- ArchOversight 4y agoMy 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. 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. Electron applications are wasting so much CPU time and power. 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. Just, no Electron applications and stuff sips battery.
- invalidname 4y agoMine gave me 10 hours easy. With electron slack and other apps. The trick is to kill all Intel apps which you can filter out. Once I do that it just keeps running and remains cold.
- buffington 4y agoAny chance your IT/Infosec team has software running on your work machine? I've seen times when security software will chew up CPU when the machine is idle. That said, my M1 has all sorts of gnarly IT/Infosec stuff running (banking industry) and even that doesn't seem to make a dent in my battery capacity (on top of using several Electron based apps all day long as well).
- ArchOversight 4y agoThere's a ton of that sort of software, but with the upgrade to Ventura they dropped a whole range of them and really pared it down. Much of that stuff doesn't take up a whole lot of CPU anymore.
- bonney_io 4y agoMy 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. Overall I've found myself impressed with VS Code's efficiency and performance as an Electron app, especially versus Discord (gross) or Teams (awful).
- miga 4y agoWhen coding, you usually will have linter or compiler taking 100% core in the background.
- elliottkember 4y agohttps://code.visualstudio.com/blogs/2021/02/16/extension-bisect https://code.visualstudio.com/blogs/2021/02/16/extension-bis... 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.
- geodel 4y agoSeems 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.
- happymellon 4y ago> Lets be honest M1 MBP is dinosaur when it comes to modern dev tools That's amazing that you would come to this conclusion, rather than the tools are atrocious.
- ilrwbwrkhv 4y agoAnd 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.
- invalidname 4y agoI work for many hours with IntelliJ/IDEA. 4 open browsers with 100+ tabs in total. Presentation and video software. The works. Docker will sabotage performance and battery life. The worst are x86 processes. Make sure to have only ARM processes.
- buffington 4y agoMy 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. 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. Prior to this machine, my Intel MBP would have melted into a puddle after using its entire battery in 20 minutes.
- TMWNN 4y agoI 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?
- fwlr 4y agoIn my web dev work I use Chrome, Firefox, Safari, and Safari Tech Preview on a 2021 M1 MacBook Pro. My (anecdotal) experience is yes, Chrome eats M1 battery. This is true for Chromium as well, so Electron apps eat battery too. Some people have found significant battery life savings from avoiding Rosetta; maybe check if your Excel is running native Apple silicon or through Rosetta (iirc they very recently updated Excel for Mac to run native).
- TMWNN 4y agoMy Excel is indeed running natively, but I did find via Activity Monitor two other leftover things that are Intel that I should either get rid of, or update. I doubt they're the cause of any significant battery drain compared to Chrome (actually Edge now, but I doubt it's any better given the Chromium base), and I have other Intel software without Apple Silicon alternative, but it was still a useful thing to do.
- ravagat 4y agoYeah 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