How I doubled the battery life on my Mac by closing one tab in Chrome
medium.com
medium.com
killall -9 -m "Chrome Helper"
It kills all Chrome tab renderers, but you can easily reload them where you left off. Ultimate battery saver.Chrome seems to even remember textarea / input contents.
Edit: Not that I've ever had any issues with that simple killall, however the following might be safer, it tries to match the process path, name and "--renderer" command line parameter:
pkill -9 -f "Google Chrome\.app/.*/MacOS/Google Chrome Helper .*--type=renderer"wmic Path win32_process Where "CommandLine Like '%chrome.exe\" --type=renderer%'" Call Terminate
Tried it on Windows 10, latest Chrome. Ctrl-r didn't work on those killed tabs, had to click reload button. But other than that, the effect seemed to be same than on OS X.
Use at your own risk.
You can't use taskkill, because on Windows, all Chrome processes have the same file name, chrome.exe.
Edit:
This one should be a bit more reliable and safer. Note that it is not completely visible because of HN CSS:
wmic Path win32_process Where "CommandLine Like '%--type=renderer%' and Name='chrome.exe'" Call Terminatehttps://chrome.google.com/webstore/detail/the-great-suspende...
https://chrome.google.com/webstore/detail/onetab/chphlpgkkbo...
edit to add link: https://chrome.google.com/webstore/detail/session-buddy/edac...
So... great? All true, but why is this on HN? This is the sort of tip which belongs in a "...For Dummies" book.
Again, all true, but I don't understand why it's here.
But if the developer of that site left somewhere in JS something like while(true) {...} that page will drain your battery, even if you're not looking at that specific tab. And even if you are in other app than Chrome.
I like to play FTL, and it makes my laptop sound like a vacuum cleaner, with a 1.5 hr battery life. And that's a freaking turn-based roguelike. But I can run an old SNES emulator for an hour and barely touch my battery.
Go figure.
My point was that you cannot simply see the things clearly from the Activity Monitor. And many people are not aware that the Task manager exists in Chrome.
Which is all again related to summatory of work over time = power consumed, same for humans, for ICE and electric motors...
I'm starting to think there is some troll creating entries with apple products just for the sake of almost divine apple status.
Edit: yay downvotes because I don't respect Mac cult. Get over it; it's a Pc!
I 100x increase my Mac battery by putting it to sleep.
This post is newbie in all senses. He could get a console over the webpage, check the javascript or offending logic and create a post like this:
Increase your users happiness (and battery life) by improving XYZ (e.g. polling behaviour) on your webpage. -Improving responsive design with battery life in mind
which identifies a problem and propose a solution.
"Please resist commenting about being downvoted. It never does any good, and it makes boring reading."
https://news.ycombinator.com/newsguidelines.html
there's also a FAQ if you haven't read that either: https://news.ycombinator.com/newsfaq.html
That aside, I'm unclear why so you're riled up about mentioning their Mac in the title. If I were to write such an article I'd probably have written "How I doubled the battery life on my Dell XPS by literally closing one tab in Chrome".
Further software is a gigantic field. There is stuff that is basic to one person that is voodoo to someone else. This is usually bi-directional: things that are basic to you are voodoo to me, and things that are voodoo to you are basic to me. That's another reason this belongs here.
And if nothing else: I suspect there are many people, such as myself who know that some browser tab is responsible for my mbp being warm, or eating battery, but just put up with it for convenience reasons. Until today that is, when we learned about the chrome per-tab task manager tool.
I accept that this is valuable information, but HN is not really about obvious information that's easily searchable.
Because apparently the kind of people who spend the most amount of time idling/voting on tech websites and are newbies.
I was hoping the top comment here would be interesting, like it would be about why exactly the currency conversion page is so processor intensive and how to make the same exact functionality without that problem.
But, no, it's a discussion about a discussion.
The useful thing with this article is that it tell one cannot really estimate the battery usage of a user, even knowing much of his habits.
I think the reason is that HN readers (most people?) are great gobblers of "fun fact" information. Just look at how many random mostly useless trivia makes it to the front page...
Actually Chrome does slow down tabs in the background. On my computer whenever I put a CPU heavy tab in the background, it crawls to a snail's pace. And if you don't touch it in a long time, it is suspended and saved to the hard drive.
Which is why this story is weird. This shouldn't even be an issue.
That is a naive view on it. Javascript can be doing a LOT of things. It could be rotating a product carousel; or it could be running a browser game. In both cases that's something that can use a LOT of CPU, but in the latter case the user might want it to continue processing in the background. How is the browser supposed to differentiate this on its own?
Doing it manually would be great, but then you run into Chrome's obsession with remaining simple and "slim", regardless of whether this happens to the detriment of users.
It does remind me of the serious issue with horrible Ad heavy sites and opens broader questions like are there other plugins/apps to ban cpu intensive sites? Even google getting involved with a ranking of how cpu intensive a site is might be interesting. In fact I was expecting the article to go down that path and was rather disappointed it was so simple.
I recently had to disable javascript on Wikia because the site had useful information but the Ad javascript code was horrific performance wise.
Another minor thing I do is if I'm working on a game/visualization, at least in debug mode I make then pause if not the focus. Otherwise as I flip between my editor and my app/page the app/page is eating battery as it continously renders
I wish Firefox had an ability to see which tab was hogging resources.
[1]
I've noticed some site's scripts really don't like coming back from a long sleep so maybe it was some edge case like that causing it to eat so much CPU.
And the CPU profile if anyone will analyse it further: https://dl.dropboxusercontent.com/u/47486136/CPU-20160217T17...
Today it is Node that's draining my battery.
ps: also check extensions, a few can leak GB of memory.
Seriously, you should always close what you do not need. It is not only for energy efficiency, but for security as well.
It's not a great write-up, but it isn't about closing an app.
It is about the potentially surprising impact of individual tabs that keep code running, and a way to identify them.