9 ms·
I am not a Firefox user but know that matching Webkit performance on macOS is going to be very hard. So just fired a test on my Macbook Air - Safari 13 vs Fire
by freediver 7y ago
I am not a Firefox user but know that matching Webkit performance on macOS is going to be very hard.
So just fired a test on my Macbook Air - Safari 13 vs Firefox 70.
Opened top 10 links from techmeme. Both windows in background.
Firefox 70:
Energy use 30-200; CPU 20-25%; Threads 82
Safari 13:
Energy use 0.1-5; CPU 2-5%; Threads 11
If this is to celebrate I can only imagine what the things looked like before this release. Save for Apple fiddling with the energy use numbers (VW style) this means that my battery is going to last 4-5x longer with Safari. Can anyone replicate this for the sake of argument?
Edit: uploaded screenshots https://imgur.com/a/4L64ShP https://imgur.com/a/4L64ShP
- jacurtis 7y ago> this means that my battery is going to last 4-5x longer with Safari Well it might last 4-5x longer if you run safari in the background, since that is what you tested. But wouldn't the real test be running both browsers as the active window and comparing those results? One thing that Safari is incredibly good at (and its' engineers are proud of) is the ability to reduce resource consumption for non-active tabs and windows to nearly zero. This is really good when running on battery because it is a shame to dedicate resources to things that aren't even visible on screen. But this could make the results far more dramatic through your test. I would hypothesize that Safari still wins your performance test (if you were to re-test using them both as "active" windows), but probably not as dramatically as in the inactive window test.
- freediver 7y agoI used that use case because I usually have multiple windows with multiple tabs in the background. I measured it with active windows now. Screenshots: - Both in background - Safari Actie - Firefox Active https://imgur.com/a/4L64ShP https://imgur.com/a/4L64ShP Conclusion: it gets even worse for Firefox. Edit: At the time of test Safari had 7 more windows open with probably 70+ tabs from my previous session that I didn't close.
- devit 7y agoYou are not running uBlock Origin, so ads might be taking up all the CPU cycles they can get their hands on.
- ebg13 7y ago> But wouldn't the real test be running both browsers as the active window and comparing those results? No matter what you're doing, all but one of your tabs will be in the background at any given moment.
- jdironman 7y agoWhat about 4 windows, 2 for safari, 2 for FF in windowed mode? But I guess only window can be active at a time.
- tomaskafka 7y ago> One thing that Safari is incredibly good at (and its' engineers are proud of) is the ability to reduce resource consumption for non-active tabs and windows to nearly zero. I understand this is rare, but I just have a very very hard time understanding what is so hard about this. Page not visible? Just stop it. Stop the layout engine, stop the javascript VM. If there was a transfer in progress, let it finish, a page might get the callback when it's active again ... (I know there are some tricky cases, a lot of them, but there just isn't any reason why a browser with 30 tabs should be consuming over 1 % cpu...)
- pmontra 7y agoYouTube music video running in another tab. Should it stop render the video and keep playing the audio? Maybe feasible but it should keep receiving both the video and audio data. Stop all of it? Not what I wish to happen.
- dwaite 7y agoThe javascript engine and rendering engines are what are generally affected by being backgrounded. So yes, generally the media library will continue receiving the combined video/audio stream and not bother rendering the video frames
- baby 7y agoWhat about a timer running in a different tab?
- tass 7y agoDoes HTML video need to catch up based on the most recent keyframe? If they don't render while backgrounded, how do they do that without being noticeable?
- vrodic 7y agoChrome does this for a long time now and I don't consider it an issue. You see a frozen version of the last decoded keyframe until the next one is decoded. Elegant solution IMO.
- HunOL 7y ago> One thing that Safari is incredibly good at (and its' engineers are proud of) is the ability to reduce resource consumption for non-active tabs and windows to nearly zero. This is really good when running on battery because it is a shame to dedicate resources to things that aren't even visible on screen. But this could make the results far more dramatic through your test. Does it mean that page in background isn't updated in Safari?
- maximente 7y agowhat would be interesting is running with state of the art ad blocking in safari (which IIRC they recently changed) and firefox with ublock origin on multiple domains so as to better approximate advertisement load across the web i posit that ad blocking is actually a net resource saver, probably not at the level of using safari over firefox but certainly over unprotected firefox (i am on gnu/linux or else i'd do this myself)
- munmaek 7y agoTest: open 10 tabs of techmeme.com, on OSX Catalina (10.15 Beta), on a 2015 retina 13" macbook pro. Firefox: Threads 71, %CPU 2.5. Energy: 0.4. Opening the tabs all at once took up ~68% CPU. Energy went up to 75. Safari: threads: 8, %CPU: 0.7-2. When opening the tabs: %CPU: 28%. Energy usage: 2.4. Firefox grew sluggish when opening that many tabs at once. Safari handled it like a champ. Pretty bleak for firefox.
- billiam 7y agoMozilla's priorities are (and have mostly always been) for FF on Windows. It's a gripe that me (and the great majority of FF devs who use Macs and Linux boxes) have been suffering under for years) that those OSs will just never be the highest priority--and the reasons why have much to do with Apple and their Apple-first mentality for their platform. It is only partly a joke that the last users of Firefox will be software developers and their grandmothers. But there are a lot more grannies than devs.
- daemin 7y agoAs other people have mentioned, Safari doesn't load/run tabs in the background. What happens when you switch to each of those tabs so you can use the site?
- paulcarroty 7y agoSomething like this happens on my Linux laptop: Firefox eats battery 2-3 times faster than Chrome & cooler activity is much more higher. Seems like Firefox cares only about Windows.
- pcwalton 7y ago> Seems like Firefox cares only about Windows. …which is why all the work was done to support Core Animation on macOS?
- dwaite 7y agoTo be fair, CoreAnimation was first released a year before FireFox 1.0.
- pcwalton 7y agoFor many years CA wasn't hosted in the window server; it was rendered locally within the app via GL 1.x, which is worse than what Firefox was doing. And window server rendering didn't result in large energy consumption gains until Retina Displays came around.
- Khaine 7y agoRetina came about in 2012. That was 7 years ago!
- The_rationalist 7y agoAny number about chrome?
- willtim 7y agoIIRC Safari achieves this by suspending the processes in background tabs, which could be running inefficient JavaScript (polling for new ads etc). There's no cross-platform way to do this, but I think Mozilla absolutely need to try and find a way to address this. Web sites cannot be trusted to write efficient well-behaved JavaScript and so the burden of taming it falls upon the browser. There is probably some throttling going on, but clearly not enough. Running background JavaScript should be an opt-in permission, not the default.
- Vinnl 7y agoThere is an extension that does roughly this: https://addons.mozilla.org/en-US/firefox/addon/total-suspender/ https://addons.mozilla.org/en-US/firefox/addon/total-suspend... (Not to say that it wouldn't be good if Firefox was better at it, but for those using Firefox, it might still be interesting until then.)
- roca 7y agoFirefox can and does aggressively throttle JS in background tabs. However, it's not easy to do this in a way that doesn't break sites. Sometimes background tabs have JS doing actually useful work --- playing audio, running a simulation, receiving notifications, stuff like that. I don't know what Safari is doing differently to Firefox, and no doubt Firefox can improve here, but when people say "it's easy, just completely stop running JS in background tabs" they have no idea what tradeoffs that entails. (Just as when people said "browsers should just refuse to autoplay videos" had no idea what they were talking about.)
- chii 7y agoWhen people comments "it'd easy to..." or "just so XYZ, it's simple", it means they haven't actually done the work before, and is just sprouting bs.
- mantap 7y agoThe answer is simply that yes Safari breaks websites, but users are happy to make that tradeoff. It's common knowledge among web developers that browsers aggressively throttle background tabs so anybody who is designing a website that depends on it is misguided. I don't hear anybody complaining about Safari being too aggressive with background tabs, I do hear people complaining that Firefox uses too much battery. So I think Firefox should be more aggressive.
- BuckRogers 7y agoOn Windows I've been testing the new MS Edge because I've noticed my laptop has significantly higher CPU usage running FF. The reduced battery life is one thing, a hot laptop is another. Currently the new Edge is not as well optimized as the original, but there's more to come on that front. I've been using FF since it was in beta, never left but I'm starting to come around to the reality that native browsers are best optimized for the device. While there's no real native browser to leverage on desktop Linux, on macOS/Windows, native may be the best way to go for most people. This is how break down browsers to friends and family. Google Chrome- optimized for Google's needs and profit margin. Microsoft Edge- optimized for your device, if running Windows. Apple Safari- optimized for your device, if running macOS. Mozilla Firefox- optimized for the user. Certainly a noble goal, but I increasingly have a "mobile" goal and that trend isn't slowing for anyone.
- acqq 7y agoYes, I also observe much more power drawn even on a single page (especially if it contains animations) opened in Firefox vs any other browser, and on Windows, IE is significantly less power hungry. I've also checked this newest version, 70 on Windows and my measurement of the power use give practically identical results to the measurements I've done almost two years ago. I see that the power drain comes from the browser's own code doing something unnecessary and as far as I see it doesn't even appear to platform dependent. It's surely possible to optimize that and it's obviously not their priority.
- BuckRogers 7y agoIf you would share any of your findings, I'd be interested to see that. From what I've read, Mozilla can't really optimize rendering to the level of Safari & Edge. I found this article[0] on WebRender to be very interesting on this front. The author noted- "Note: Painting and compositing is where browser rendering engines are the most different from each other. Single-platform browsers (Edge and Safari) work a bit differently than multi-platform browsers (Firefox and Chrome) do." I love Firefox quite a bit, every detail, the way it scrolls with smooth scrolling off, the dedicated search bar for switching DuckDuckGo bangs, the container support. The dedicated search bar is a huge one, I can't imagine why no one else at least offers that, as a feature it can't cause that much maintenance headache. I definitely love FF as much as anyone here but I'm not one who argues that Gecko is necessary for a standards-based web, I'm not convinced by the argument. Webkit can be forked again and it has a significant userbase to act as a counterweight to Blink. It's increasingly difficult at this point to convince myself that native browsers don't make the most sense. [0]https://hacks.mozilla.org/2017/10/the-whole-web-at-maximum-fps-how-webrender-gets-rid-of-jank/ https://hacks.mozilla.org/2017/10/the-whole-web-at-maximum-f...
- pfranz 7y agoI just can't imagine Firefox will ever be performant as Safari. One is written for a single platform developed at the same company that develops the hardware and OS (I'm not trying to belittle the Safari team--it's kind of amazing what they do). The other is developed separately, must equally support at least 2 other OSes and has an expectation for supporting older setups. My problem is that Safari won't work for me as a daily driver so it's not an option. It seems too aggressive in memory management and in reloading. So I'm very happy to see Firefox improve performance over Firefox-v1.
- saagarjha 7y agoWebKit also works on other platforms.
- deaddodo 7y agoYou're thinking of Blink. WebKit is pretty exclusive to macOS and iOS these days.
- saagarjha 7y agoNo, I'm not; I'm actually typing this from WebKit on Linux. I'd actually guess that WebKit runs on more platforms than Blink does…
- deaddodo 7y agoI didn't say it didn't run on other OSes. But the big ones are mostly iOS and it shows in the targeting of the development. Blink is what's on most (non-gecko/servo) browsers people use now (chrome, chromium, Opera, the new Edge browser, etc). > I'd actually guess that WebKit runs on more platforms than Blink does… I'd say they're probably at parity, if not a small edge given to Blink since an entire OS is built around it. Which would be the only exclusive case of the two I can think of. I'm actually curious which WebKit browser you're using. GNOME Web?
- 7y ago
- Scarbutt 7y agoSafari is a high bar to reach but they are getting closer to Chrome.
- mthoms 7y agoFirefox users should take a look at the "Auto Tab Discard"[0] extension. It offloads inactive tabs, saving CPU and RAM, (similar to how Safari works). It doesn't work quite as transparently (or effectively) as Safari's equivalent functionality, but it does make a noticeable difference. It's worked very well for me. [0] https://addons.mozilla.org/en-CA/firefox/addon/auto-tab-discard/ https://addons.mozilla.org/en-CA/firefox/addon/auto-tab-disc...