This article by Sebastian Anthony made its way around the web today: "Iframe irony: Adblock Plus is probably the reason Firefox and Chrome are such memory hogs"
He reminds us all that the original promise of AdBlock was to speed up browsing by decreasing memory and CPU load and keeping our browsers from loading ads and other unwanted parts of webpages.
And the problem isn't just linear (yes, CSS blacklists have become incredibly large, and that takes CPU and memory every time you go to a site); it's also structural.
"... nowadays it is very common for a webpage to have lots of iframes, which are separate, individual webpages that are loaded and embedded within the page you’re currently looking at. The most common example is the ubiquitous social sharing widget (Facebook, Twitter, etc.) which is actually an iframe containing a separate webpage hosted on Facebook/Twitter’s servers."
As an example, he loads the VIM Color Scheme Test site which contains hundreds of iframes. He notes in his tests that AdBlock caused the RAM usage for that site's tab to balloon from several hundred megabytes (without AdBlock) to "almost two gigabytes" with it.
I run quite a few extensions I use daily. The ones I would say I use and feel dependent on:
So, of course, I tested this myself.
I loaded up the Color Scheme test site and watched in the Task Manager (hit Shift + Esc in Chrome) as the site's RAM usage ballooned into multiple gigabytes and then crashed.
I disabled ABP and Ghostery -- and it did the same thing. Hmmm...
Slowly, and with horror, I realized it was the friendly extensions I used every day that were causing this to happen, not just the maligned ABP.
Here are the numbers:
Test site: VIM Color Scheme Test - C
Starting RAM usage, no extensions: 77,100k
.. with just 1Password: 734,548k
.. with just HoverZoom: 964,764k
.. with just Vimium: 818,696k
With 1Password, Gmelius for Gmail, Hover Zoom, Twipster, Vimium: 1,793,000k and climbing. (And multiple suggestions from Chrome to kill the tab.)
For me, this has been a revelation.
I had no idea the effect modern website building was having on my extensions -- and therefore the performance of my machines.
The conclusion for my own browser choices aren't so much about cutting out AdBlock for performance reasons, but simply understanding what effect iframes are having on all the extensions that are important to me.
Jeff Atwood posted a link to "uBlock vs ABP", and I've switched over; the performance hit is less.
Granted, the increase in memory and processing load is not nearly as high in most cases as with the example site, but I think the takeaway still stands: installing a browser extension affects your computer in a non-negligible way -- and if something is going wrong, you're missing part of the picture by simply blaming the site or the browser.
Further interesting reading and reactions:
- Raymond Hill (developer of uBlock) counters the argument "Who cares about efficiency?"
- As the original article points out, everyone should be using ClickToPlay in Chrome to stop all plugins from loading until you want them to. It's built into Chrome.
- Also suggested by the artcile, I'll be looking into Privoxy, but it's not something I feel I need immediately.