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.
VsCode + Docker on Mac + devcontainers (at my last job) make for an atrocious development experience. It was a major contributing factor when I left that job.
Is it just me, or is VSCode kind of confusing on how exactly everything works/integrates? When I've tried using it for Python work, getting it to use the right venv/binary seemed difficult and it has all these add-ons that I don't know where they're installed or fetched from.
I feel old. I just want highlighting and intellisense to work.
VsCode extensions contribute significantly to battery drain as well. The more extensions you have running, coupled with a larger codebase, the more compute needed to reindex for autocompletion, warnings etc.
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.
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.
Any 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).
Mine 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.
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.
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.
Wow, 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.
Ah, 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.
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.
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 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.
Was 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.
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.
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.
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?
In 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).
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
Your 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.
[+] [-] mrtksn|3 years ago|reply
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.
[+] [-] crazygringo|3 years ago|reply
Because this sounds like constant 100% CPU usage on at least one core.
[+] [-] scruple|3 years ago|reply
VsCode + Docker on Mac + devcontainers (at my last job) make for an atrocious development experience. It was a major contributing factor when I left that job.
[+] [-] Hamuko|3 years ago|reply
[+] [-] unethical_ban|3 years ago|reply
I feel old. I just want highlighting and intellisense to work.
[+] [-] tzhenghao|3 years ago|reply
[+] [-] 999900000999|3 years ago|reply
[+] [-] 2OEH8eoCRo0|3 years ago|reply
Yes they are. But why can my crappy work laptop with an i7-1185 do it then?
[+] [-] elliottkember|3 years ago|reply
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.
[+] [-] ArchOversight|3 years ago|reply
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.
[+] [-] buffington|3 years ago|reply
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).
[+] [-] invalidname|3 years ago|reply
[+] [-] brarsanmol|3 years ago|reply
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|3 years ago|reply
[+] [-] turtlebits|3 years ago|reply
[+] [-] buffington|3 years ago|reply
[+] [-] klooney|3 years ago|reply
[+] [-] tecleandor|3 years ago|reply
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.
[+] [-] ChrisMarshallNY|3 years ago|reply
[+] [-] fxtentacle|3 years ago|reply
[+] [-] fathyb|3 years ago|reply
[+] [-] wahnfrieden|3 years ago|reply
[+] [-] bonney_io|3 years ago|reply
Overall I've found myself impressed with VS Code's efficiency and performance as an Electron app, especially versus Discord (gross) or Teams (awful).
[+] [-] zora_goron|3 years ago|reply
[+] [-] cramjabsyn|3 years ago|reply
[+] [-] nicolaslem|3 years ago|reply
Editors are pretty efficient, linters on the other hand not so much.
[+] [-] elteto|3 years ago|reply
[+] [-] bobleeswagger|3 years ago|reply
[+] [-] ilrwbwrkhv|3 years ago|reply
[+] [-] buffington|3 years ago|reply
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|3 years ago|reply
[+] [-] fwlr|3 years ago|reply
[+] [-] ravagat|3 years ago|reply
[+] [-] 999900000999|3 years ago|reply
Edit: I'm using VS Code as my IDE which seems to be the actual issue.
[+] [-] jdlyga|3 years ago|reply
[+] [-] jandrese|3 years ago|reply
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.
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] invalidname|3 years ago|reply
Docker will sabotage performance and battery life.
The worst are x86 processes. Make sure to have only ARM processes.
[+] [-] kayodelycaon|3 years ago|reply
[+] [-] peterhartree|3 years ago|reply
I bought an iPad Pro recently, so I can leave the 16" plugged in at the office.