Hacker News new | past | comments | ask | show | jobs | submit login
Upcoming Firefox update will decrease power usage on macOS by up to three times (zdnet.com)
331 points by n1000 on Sept 4, 2019 | hide | past | favorite | 71 comments



> This, according to a series of tests, has put Firefox on par with Chrome, in regards to power usage.

So still not awesome, but a round of applause to the team nonetheless. Not a small achievement.


Whic is odd, as I find FF better than Chrome for energy usage, but still trailing Safari.


The big X-factor is extensions. I think these stats usually measure the browsers where neither has any extensions installed.


And I think Safari Extensions are pretty much non-existent now, so it's probably never going to be a fair comparison.


They're mostly distributed on the App Store these days. The old distribution channels are still available, but installation using these trigger a warning.


You didn't see the worst of the power usage issues manifest themselves until you ran the program on a Retina display using scaled windows.


Yep, it's unusable for me at work on my scaled display. It isn't just power consumption, scrolling is noticeably slower. I've been checking in on this issue every release, looks like I'll finally be able to go back to Firefox after 70 is released.


Until the big changes land, you can have Firefox opt out of window scaling.

Get info on the Firefox app and then check ”Open in Low Resolution” on the get info panel, then restart the app.

You can pick up more energy savings by telling Firefox to stop using transparency.

Go to about:config, and set gfx.compositor.glcontext.opaque to true.


The good news is that this is just the initial CoreAnimation work. Further improvements are in store.


Firefox has been my only browser since quantum appeared. However, on my 10inch 2-in-1 tablet with 2gb ram and an Atom Processor, Firefox's performance has been subpar.

Pages will freeze, tabs become unresponsive. Closing the browser doesn't work. It remains in process, eating up 70-80% of CPU until I terminate the process with task manager.

Because of this, I'm back with chromium (Opera and Edge). I thought Firefox 69 would change things but it hasn't.

For touch screen friendliness, all desktop browsers suck at the moment (Classic edge's basically unusable for me.) Firefox is definitely better than opera in this regard though. But I want a button to switch to touch mode - make buttons bigger. No need for AI to guess which mode I'm currently on.


I have the opposite experience with my old Lenovo B8080-F (Android 4.4.2) 2GB RAM that I use in the bath. If it wasn't for Firefox, this thing would be useless. Chrome takes forever to start up and is pretty much unusable on any modern page.


Yeah, but that's Firefox for Android, versus Firefox (Quantum) for Windows. Not the same "beast" underneath.


Are you running low on memory?

This is has been my experience with Firefox on a laptop with 4GB. If the commit size for any of the content processes goes over 1GB, Firefox tabs stop responding. Killing the content process in task manager brings the browser back to life.

Sometimes the browser slows to a crawl and CPU usage spikes (making me wonder if it's memory compression kicking in -- though I haven't verified). Other times tabs are responsive but links just make the spinner go (as if I've hit a socket limit).

It's almost always fixed by killing the content processes (making sure not to kill whichever one is running addons!). I guess this is a little better than the old days when a few times a day I would just restart the whole browser.


Using Firefox on a 2-in-1 indeed leaves things to be desired. When pinch zooming, it seems to treat the pinching like normal page zooming instead of having a smooth viewport zoom.


Thought you'd find this useful:

Was really frustrated today. And searched for a way to make firefox a bit more touch friendly.

1. Launch Firefox, click on the hamburger menu and navigate to “customise”. 2. In the customise sub-menu, look out for “Density” settings at the bottom left of the screen. 3. Select Touch Density, and tick the option for using Touch density in Tablet Mode as well.

source: https://mspoweruser.com/how-to-set-up-firefox-quantums-inter...


That sounds like the sort of decision made as time to meet the launch deadline ran low, with the intention of circling back and fixing it over time. The result is that the text and imagery does get bigger and easier to read but it's not yet optimal.

I have no insight into their dev process but this theory can make sense based on my experience working in the industry.


That's interesting. On my (modern i7) laptop, I notice Firefox is much less resource intensive than chrome. Maybe it just thrashes when there's not many cores available?


I have many laptops. But only use two ATM - on the Dell core i5 6GB ram, Firefox runs smoothly. My previous daily driver a hp envy core i5 also has no issues with Firefox. Chrome was SLOOW on the Envy and pushed me over to Firefox.

It's the Packard Bell (detachable screen Atom x5-Z8350, 2GB ram) that I'm having issues with. I don't know if it's because I'm always on battery saver mode. Disabling all my extensions didn't help.

>Firefox is much less resource intensive than chrome

I have the same experience with both core i5 laptops. Installed Opera - not chrome on the detachable. I can't compare the memory usage btw opera and Firefox because I've got more extensions running on Firefox.

Please note, I once disabled all extensions but it made no difference.


> Atom x5-Z8350

That's a pretty modern 4 core cpu. It's low power, but it's not too shabby. It's a shame Firefox doesn't seem to like it.


Give "Firefox Lite" a try. It is available in Asian countries only, so find its apk.


I'm on windows thanks.


Let's hope this marks a care for Firefox on macOS by the developers, it has been neglected for years now.

I hope proper trackpad support is next.


From the bugzilla[0] about Pinch to Zoom last year: "We definitely haven't forgotten about this, and we are working on it (as other priorities permit)."

[0]https://bugzilla.mozilla.org/show_bug.cgi?id=688990


If you are on 69 or higher, go to "about:config" and enable "apz..allow_zooming". It's still a little buggy, but it works quite well


How does one optimize applications for power usage? Should it avoid using GPU? Should it run computations in batches?


The main change in Firefox is to use the system compositor (via CoreAnimation) to composite components of Firefox windows. Until just recently, Firefox composited its entire window into a buffer using OpenGL, and then sent that to the system compositor. Unfortunately, with that method, you have to send the entire window to the system compositor on every frame (because the APIs are just limited that way), which uses a lot of power when just one little caret is blinking, for example. With CoreAnimation you can set things up so that large chunks of the window that aren't changing never get recomposited.

Unfortunately this change is somewhat invasive, which is why it wasn't done long ago.


Additionally, you can avoid using a transparent window this way, which means that the window server doesn't have to draw stuff behind the main Firefox window. You can do this with the old compositing method too, but you lose the rounded window corners and the vibrancy effect.


Long ago? That is what enabled the original Mac GUI in the 1980s. I am having trouble understanding why anyone would have shipped anything else—what was missing in the time of earlier Firefox?


APIs for partial compositing in combination with hardware accelerated compositing was the thing that was missing. If you don't use hardware accelerated compositing, repainting only part of the window, and letting the system compositor know about those areas, is not a problem. It's only the GPU acceleration and the lack of convenient APIs that makes this a problem.

Before Firefox got hardware acceleration, so up until Firefox 3.6, we were using CPU-side painting and sending accurate dirty areas to the windowing system. With Firefox 4, we added hardware accelerated compositing, which made scrolling and transform / opacity animations a lot more performant. However, it also meant that we switched to using OpenGL for the compositor, and macOS does not expose any APIs for invalidating only parts of an OpenGL context. And at the time Firefox 4 shipped, "retina" displays were not a thing yet, so the impact of recompositing the entire window was not apparent. And there was the pervasive notion that "modern GPUs are fast, fill rate is not a problem". It was only as pixel count grew and grew that this started becoming problematic. And it took some amount of research and a lot of surgery to switch Firefox to an approach that gets OpenGL content to the screen while also allowing for partial updates of that OpenGL content.


Core Animation wasn't integrated into the OS window server until somewhere around Mac OS X 10.7. Before then, Core Animation on Mac OS X ran in your own process, so there wasn't really an advantage to using it over just doing your compositing yourself.


Because of "Write once, deploy anywhere".


In Firefox in particular they've changed how animations are done, for instance removing transparency where it wasn't needed https://bugzilla.mozilla.org/show_bug.cgi?id=1429522#c26

In general you want to

- do less work (e.g. don't do unnecessary work, cache results)

- do it less often (coalesce the work you have so the machine can go into deeper idle states)

- do it more efficiently (e.g. do graphics on the GPU instead of CPU)


It seems they are actually using the power-not-hungry GPU more. From the v69 release note:

> For our users on macOS, battery life and download UI are both improved: macOS users on dual-graphics-card machines (like MacBook Pro) will switch back to the low-power GPU more aggressively, saving battery life.

https://www.mozilla.org/en-US/firefox/69.0/releasenotes/



I hope this will allow me to finally ditch Chrome on Mac. On Windows I changed to Firefox when Quantum was released but on my old Macbook Air it has been too slow to use as my main browser.


I am not a huge fan of Safari, but it seems so much more optimised for macOS that it has become my default regardless. I mean an hour extra battery life is really nice.


Over the last 5 years I've been slowly shifting into the Apple ecosystem. It started with a 2015 Macbook Pro which I immediately installed Chrome on because what the hell even was Safari? Chrome was basically the only browser in my universe. Then I switched to Firefox but I had so many issues with it. It was slow and buggy and made my laptop chugg along for some reason. Quantum was a good step forward, though.

But now I own three Apple devices and have fully made the switch to Safari. I'm so locked into the Apple eco system now though but it has made my life many times easier using the browser that's designed by the hardware manufacturer of all my devices.


After being a long time Linux/Android/Chrome user I got dragged into the Apple ecosystem as I received a used iPhone 6 as a student back in the day.

For my daily life, this has been a blessing. A lot of the complaints about Apple that people have (and I used to have as an avid Android user) are absolutely valid. MacBook Pros are hardly "Pro", missing ports are simply annoying, weird multi-display handling and breaking butterfly keyboards... all that is true to some extent.

BUT... at risk of sounding like marketing shill, in general my workflow and private usage of my Apple devices is a wonderful fresh breeze. 99.8% of the time things just work and I don't have to install third party drivers and adjust my fan speed to a Fibonacci percentage so that Ubuntu's WiFi works after waking the laptop from sleep.

Hell, a large portion of the added cost (at worse specs) compared to Dell or ThinkPad is completely worth it in order to have an amazing trackpad which is still miles ahead of any other device.

Maybe I should finally give Safari a serious go as well. I always avoided it due to its image of a less feature-rich browser.


I probably sound like a shill too but while there are definitely many valid complaints, I still feel like being in the ecosystem makes my life a lot easier. I don't have to do any hacky workarounds. My favorite one that I discovered last year was sharing WiFi passwords. I was at my buddies house and asked for his WiFi password but we both have iPhones and it automatically asked him to share the WiFi password with me. It was a beautiful experience.


I went through exactly the same steps. Safari finally showing Favicons in the tab bar gave me the final push. This is probably the case for a bunch of "power users" I'd guess.

As Gruber (https://daringfireball.net/2017/08/safari_should_display_fav...) said:

> It might sound silly if you’re not a heavy user of browser tabs, but I am convinced that the lack of favicons is holding back Safari’s market share.


If only Safari had proper extensions, I'd give it a go. Unfortunately, Apple has crippled them so badly.


+1 to Safari as default.

One issue is that if you login to some sites (e.g. Gmail) in a private window and then close it, some processes keep running forever. They seem to use lot of memory and a bit of cpu. Terminating the entire browser is the only way to kill them.


The main issue with safari, for me at least, is extensions. I use vim-like shortcuts on chrome/firefox and I feel awfully slow without them. Safari has very few extensions, and the few that exist don't really work well.


Yes – did not find a decent (up-to-date) adblocker yet.


Try Wipr, it's super simple and minimal and it works very well, but it costs $2. If you want something free with more customization options (and open source) there's Adguard


I was using uBlock Origin until the move to the App Store (Mojave).

1blocker works well enough ever since then that I had to look it up on my laptop. Also available on iOS but I use Purify there.


With how good reader view is on both Safari and Firefox, I tend to rely on the ad-blocker less and simply use reader view when the page is finished rendering.


Save you a click: They switched to core animation.


Also, is it journalistic best practice to put the only information that's not in the headline in the last paragraph of the story? That's the opposite of what I learned in school.


For ad revenue they optimize around time on the page. Putting the key information at the end is becoming a more common practice.


I would love to be back on FF, which was my daily driver for most of the last two decades. I had high hopes for Quantum, but I didn't love it. When I heard that Brave had switched to Chromium (and supports most Chrome extensions), I tried it and haven't looked back.

I will try this new version of FF, and I hope it can win me back. Tree Style Tabs is unparalleled, and I've yet to find a Chromium-compatible version that works as well (currently using Sidewise, but don't like that it's in a separate window).

But Brave is so darn fast, I will not be surprised if FF doesn't win me back. Glad they're improving though, and at the very least pushing the whole field forward!


Presumably it reduces power usage by up to 2/3rds, not 3x. (You won’t be using Firefox to charge your MacBook.)


Having it decrease by 3x is the same as dividing by 3...


If the reference power level was 30W (purely to make the math easy to do), and the “power increased by three times” what would the new power level be? 50W, 90W, or 120W?

If 120W, then why is a “decrease by three times” different?


30 * 3 is 90...

30 / 3 is 10.


Unambiguously true math.

If 30 “increases by three times”, does it become 90 or 120?

If 90, what happens if 30 “increases by 1 times”? Does it stay 30 or become 60?

If 60, then what does 30 “increases by 2 times mean?” Also 60?


These things are contextual.

"x increases three times" means 3x to most people. This is different from "increases by 300%" which usually means 4x. The article says "by a factor of up to three" in the first sentence but that is too wordy for a headline.

> what happens if 30 “increases by 1 times”?

Nobody would ever say this. We would say it doubled or stayed the same, or "increased by 100%" perhaps, but never "increased by 1 time".

> 30 “increases by 2 times mean?”

Nobody would ever say this either.


This reminds me of the wording in my son's homework two days ago. So much interpretation involved. I wish they would choose the wording of their questions more closely in those math homeworks (and also in articles).

For reference, his homework question was something along the lines of:

If the auditorium currently has five rows of ten chars in place, and they need three times more chairs, how many more rows of ten chairs do they need?


That's why I prefer to say "it increased from 30 to 120" and let the reader calculate if they want to. At least the right info is there. :)


Is this fix already available in the dev version of firefox?

Edit: The improvements are already available on nightly https://twitter.com/whimboo/status/1168437524357898240


The first part of the improvements is the most important one. This is already included in the Developer Edition as well. Not sure about the second part as of today.


Does anybody know if these changes will benifit users who only have intel GPUs and non-retina screens?

I can't complain about performance as-is, but even better would still be nice of course.


The change for avoiding secondary GPUs as much as possible has already landed in Firefox 69. This one is about using CoreAnimation.


I’d assume so, because activating the secondary GPU means a lot more power consumption and is therefore avoided anyway.


You can also try "pinch to zoom" on the trackpad, enabling the "apz.allow_zooming" flag


I am suffering silently through using Safari.. might this be the end?


Yes, you've now spoken, making you a vocal sufferer ;-)


What do you dislike about safari?


Will this change be backported to 68.x esr?


I would strongly doubt it, switching out the core graphics driver doesn't seem like something sensible to push into an ESR release.


duplicate




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: