Hacker News new | ask | show | jobs
by jklinger410 1070 days ago
> imagine the battery life could be better under Linux based on my experience with Windows 11 on my own laptop

God, I have experienced the exact opposite with Linux on laptops. Battery management is so bad I am considering moving to a Macbook.

4 comments

I have had both experiences. The base system for Linux will be great for battery life (has been ruthlessly optimized for power savings by the biggest companies in the world), but some of the desktop software on top will brutalize your battery.

I've experimented a lot (mainly on Fedora) and the biggest offenders are browsers, but also sometimes Gnome gets in a bad state and eats up a lot of CPU. It's often gjs eating CPU so it may be an app I'm leaving open or even an extension. I've tried to narrow it down but haven't fully figured it out yet.

But, if you keep only a small number of tabs open and close everything you aren't using, battery life on Linux can be really great.

> has been ruthlessly optimized for power savings by the biggest companies in the world

It has been ruthlessly optimized to save power for servers with greatly documented hardware structures.

It has not been optimized for Desktop OS, for Bluetooth, Sleep, WiFi, graphics card power saving etc.

I am a tab zero guy, for the record. I've been using computers since Windows 3, so I'm very sensitive towards intensive processes.

My wife can watch netflix on her (5 year old) Macbook for hours. I lose 13% battery life on one episode. I leave my laptop on sleep off the charger, and it is dead sleeping after a few hours. Linux users may hack their way to lower battery usage, but they still do not have it like Mac does.

You must simply leave it on the charger and turn it off when you are done. They are portable desktops.

A big difference in battery life comes down to hardware acceleration in your browser which depending on hardware,browser, and version may not be enabled.
eh, it's all ymmv.

i've clocked ~8 hours of media time with a T420s with an ultrabay battery and tlp/powertop reporting an average of 6-8w during the process. Regular battery + the extra ultrabay battery put the capacity up to about 7.7Ah; about the same range of battery capacity as a newish macbook pro.

a t420s is a very old core machine at this point. I would suspect the same conditions with a similar amount of battery with a modern processor could do a lot better; but i'm getting too old to sit in front of a screen for 8+ hours of media time, honestly -- and lately with USB-PD and power banks I have been skewing towards buying ultrabook style laptops and accessorizing via USB3 rather than with proprietary expansion slots.

I don't know what the media time on something like a laptop with an N100/linux + a powerbank, but I suspect it'd be quite a long time.

typo: meant 7.7aH

What does your `top` say? What does your browser's performance tool (e.g. `about:performance`) say?

I went from a constantly-overheated Linux laptop to a completely calm Linux laptop, on the same hardware, distro, and DE. Checking for unnecessary processes that eat CPU, spurious ACPI events, overly-heavyweight browser tabs goes a long way. Making sure the browser uses hardware support to play YouTube is another heavyweight.

It takes some time, but much less time than I had expected.

So the Mac has battery saving built in to the OS. You are doing a lot of reverse engineering to achieve something other software/hardware does automatically.

And to be specific, I suffer from bad hardware/software communication. On a linux laptop, no less (System76, which I would never recommend). Linux S3 sleep is not hardware sleep, I lose a lot of battery there. WiFi and Bluetooth connectivity either has to be battery draining or have poor performance.

The battery my laptop has itself is also too small, and could only get moderately good life if it had an optimized OS anyway. Again, a Linux-first laptop.

I am sure if I switched to a Lenovo with a big battery that I would be better off than I am now, so I'm also complaining a bit about my hardware. But the problem is still there.

With Apple M2 paired with an OS designed for it, with high end batteries and screens, I don't see any pairing of (laptop) hardware and software competing, on a fundamental level. Every other system is second class.

Edit: ACPI events is the key word here, and it is not worth anyone's time to wade through that garbage to get sane laptop performance. The ACPI stuff isn't even designed for end users to alter, and it is hacked together due to all the hardware variations out there. It is simply doing the best job it can, on average.

There's kind of an implicit lie when people say linux works on laptops at all. It works on MOST laptop configurations in MOST functions. But it BARELY works in others. You find this once you dig sufficiently deep enough.

I keep my laptop plugged in. It's pathetic.

I run the OS of my choice on hardware of my choice in a way of my choice (that is, not Debian, Ubuntu, or Fedora). The small amount of tweaking I have to do to get the experience tailored for me personally is completely worth it, besides other, less tangible benefits like "free as in freedom".

If I were fine with someone else making all these decisions for me, because making them myself is more painful than accepting someone else's not entirely comfortable decision, I'd go for an Apple device, no doubt.

Tweaking the OS to play nicely with particular hardware is key. Apple are very good at it. I suppose e.g. System 76 also tweak Pop OS to run especially smoothly on their hardware. Linux is very much ready for that: when I worked at Google (2011-15), I had a Linux laptop with a Google's internal variety of Ubuntu, adapted to a relatively few hardware models they used as desktops and laptops. It worked basically flawlessly, and my T420 had like 6 hours of battery runtime browsing and coding. All I had to customize was the GTK theme and such.

Maybe something like "tweak packs" that adapt Linux to some very specific widespread hardware could be a hit.

> Linux S3 sleep is not hardware sleep

No this is completely down your hard hardware

What DE/distro do you use? I'm actually super impressed with the battery life I get with Fedora/KDE on my ASUS Ryzen laptop.
Based on my experience, I can tell you the grass is not greener on the other side.

Forced to use Mac for work, the previous Macbook Pro would lose charge _while plugged in_! The battery goes empty, it shuts off and I wait for it to recharge while off.

They recently changed mine to an M1. Battery is much better than the previous generation and could be good, so long as you're not using it for anything. As soon as the IDE/Zoom/Docker/what have you spins up, it loses charge. It is slower at loses charge while plugged in, but so long as you are not using it except for note taking, I would not trust away from a power source.

If I don't have a power source nearby, I turn everything off and switch my dev workflow to Sublime to prolong the battery.

I don't have to suffer any of these shenanigans under Linux. Granted, I have a Thinkpad, which has great Linux support, so that definitely helps.

Sounds like defective devices. Haven't had a single issue like that on any of our fleets. (mixed T2, M1, M2 devices, around 210 per fleet, around 7 fleets in 3 different countries)

Usage (varies over time...): software development (JetBrains, NetBeans, VSCode, Sublime, vim), google meet, slack, rancher desktop, docker desktop (being phased out), capture one, creative cloud, OBS, virtual desktops for local testing.

We have had self-discharge on HP ProBooks and EliteBooks but that was due to a bad USB-C implementation and was fixed with third-party chargers. Some older Dells had it too, but that was with dual power input (USB-C and classic barrel) and switching over to the legacy chargers didn't have that issue. Those run a mix of Windows and Linux.

Sounds to me like you’re using a low wattage charger that was not designed to be used with your pro-grade machine.
Or a low-wattage cable (easy to do with USB-C as cables typically aren't marked with their capabilities)