Live data from Hacker News

AdBlock Plus’s effect on Firefox’s memory usage

blog.mozilla.org

41–50 of 270 posts

Re: AdBlock Plus’s effect on Firefox’s memory usage

#41
post #31

> Many people (including me!) will be happy with this trade-off — they will gladly use extra memory in order to block ads. Well, for me the whole point of blocking ads is because they are often big flash things that hog cpu and memory. If ABP is no better, then most of the reason is gone. I'd actually like to view ads to support more sites.

Same here; I stopped using ad blockers a long time ago since click-to-plugin performs the essential function they were providing for me. Perhaps I'll reconsider when "HTML5" ads get more annoying/use more resources.

Re: AdBlock Plus’s effect on Firefox’s memory usage

#43
post #9

http://someonewhocares.org/hosts/zero/

I switched from ABP to this hosts file a few months ago and I have zero regret. My browser's faster, lighter and ads are blocked just as well as with ABP.

I actually even started splitting my hosts file: the layout is

    /etc/hosts                ('compiled' version)
    /etc/hosts.d/
    /etc/hosts.d/aaa-warning  (warning reminding me to run `update-hosts` instead of modifying /etc/hosts. Appears atop the compiled file)
    /etc/hosts.d/adblock      (that website's hosts file)
    /etc/hosts.d/base         (original system hosts file)
    /etc/hosts.d/dolead       (work-related file for development)
And I have the following functions in my .bashrc file:

    function update-hosts() {
        cat /etc/hosts.d/* > /etc/hosts;
    }

    function update-adblock() {
        curl http://someonewhocares.org/hosts/zero/hosts -o /etc/hosts.d/adblock 2> /dev/null
        update-hosts
    }
So if I want to update "adblock" (it is obviously an improper name) I simply do `sudo update-adblock` and if I change another file (mostly `/etc/hosts.d/dolead`) I'll just run `sudo update-hosts`.

Works wonders.

Re: AdBlock Plus’s effect on Firefox’s memory usage

#44

I would recommend Privoxy rather than adblock. I chose it because it can be used with any browser rather than needing to be a plugin and have had great results with it. As a bonus I have it running on a virtual server and use an ssh tunnel on any system I end up using. This gets me round filters and installing things other than ssh. So if I am using my Android phone on free wifi, I know I'm not being dns hijacked or…

A drawback is that a proxy won't be able to filter HTTPS traffic.

That depends on the proxy. Systems that effectively MITM your own network's traffic have been around for some years now. All you need for outbound connections is to install an additional certificate in your browser so the proxy can act a trusted partner for HTTPS.

I don't know whether anyone has made such a proxy for use in the kind of situation we're talking about here, however.

Re: AdBlock Plus’s effect on Firefox’s memory usage

#45

I would recommend Privoxy rather than adblock. I chose it because it can be used with any browser rather than needing to be a plugin and have had great results with it. As a bonus I have it running on a virtual server and use an ssh tunnel on any system I end up using. This gets me round filters and installing things other than ssh. So if I am using my Android phone on free wifi, I know I'm not being dns hijacked or…

A drawback is that a proxy won't be able to filter HTTPS traffic.

uh? you can totally filter HTTPS with a proxy, especially with a local one. Either use the option to activate the dump of you keys on disk (a one-liner on every browser) and point the proxy to that file, or just break the SSL in 2 and rely on the proxy for the actual cert check.

Re: AdBlock Plus’s effect on Firefox’s memory usage

#46
post #13

Very interesting. There might be an architecture problem here. Another solution is to use a proxy to block ads, like GlimmerBlocker for OSX. But I didn't investigate memory usage, though I tend to think it will be lower (plus have the added benefit of working simultaneously for all browsers).

A proxy cannot dynamically interact with the DOM, so it cannot do everything a plugin can. I think the solution is to use better datastructures in the plugin and improve the integratation of the plugin with the browser.

Re: AdBlock Plus’s effect on Firefox’s memory usage

#47
post #38
post #20

It's not just memory overhead, it is also CPU overhead. One approach is to write the filtering engine from scratch. It is what I did, without looking at ABP's code beforehand in order to ensure a clean slate mind. I didn't get it right the first time, I did spend quite a large amount of time benchmarking, measuring, prototyping, etc. Once I was satisfied I had finally had a solid code base, I went and benchmarked it…

httpswitchboard looks like a very interesting extension. I haven't payed attention to what's happening with Chrome the last couple of years, but does this mean that you can finally genuinely block requests with Chrome extensions (something that has long been a problem with Chrome's Adblock extensions)?

There is an API which can reliably block net requests: https://developer.chrome.com/extensions/webRequest

I think it has been available as a mainstream API since early 2012 (Chromium 17).

Re: AdBlock Plus’s effect on Firefox’s memory usage

#48
post #26
post #3

The first thing people complain about with browsers is probably memory usage. I doubt that many people actually understand what a browser actually does with that memory. I sure don't. 100mb sounds like a lot of memory for a webpage. Where does all this memory go to?

"The first thing people complain about with browsers is ..." They changed the browser UI, either the browser devs or the site devs via stupid javascript tricks (messing with scrolling, etc). I got driveby download powned and my CC info stolen and five spam toolbars in the UI I can't get rid of. There are too many spammy ads. They make is as hard as humanly possible to use bookmarks to encourage the use of a search en…

> They make is as hard as humanly possible to use bookmarks

Chrome has a "star" button right in the address bar, FF and IE have Ctrl+B to create a bookmark.

And both Chrome and FF have a pretty good auto-complete in the address bar (I just have to type "ne" to get Hacker News, "ma" for google mail, "youp" and "yout" for video streams, etc pp).

People vastly underestimate the power of keyboard shortcuts. I work as a freelance consultant/support guy and everyone is surprised how fast I work with even the slowest computers. Most can't believe how much time one can save by knowing at least Ctrl+C/Ctrl+V, Alt-Tab and Ctrl-Tab.

Re: AdBlock Plus’s effect on Firefox’s memory usage

#50
post #3

The first thing people complain about with browsers is probably memory usage. I doubt that many people actually understand what a browser actually does with that memory. I sure don't. 100mb sounds like a lot of memory for a webpage. Where does all this memory go to?

Many people think of a browser as a tool for displaying text and pictures, with maybe a bit of JS code and some CSS effects on the side. That was true in the late 90s, but these days a browser is actually a fully-fledged programming environment that also happens to have some incredibly sophisticated multimedia capabilities: text, images, video, audio, animations, 3d graphics, etc. The most popular websites run quite…

>and JavaScript execution is usually the dominant consumer of memory.

That's forgetting the DOM, which is often the actual cause for slowness & memory consumption, but gets far less spotlight than JavaScript. This is also a reason why a framework like react.js is so interesting: it circumvents the real DOM when computing (on a virtual DOM), and only applies the end result.

Post reply on HN