Live data from Hacker News

AdBlock Plus’s effect on Firefox’s memory usage

blog.mozilla.org

61–70 of 270 posts

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

#61
post #40

Earlier quoted context omitted.

And who would want to use a browser anywhere other than a PC, right?

We appear to be talking about ABP on desktop firefox, no?

It's true; my comment wasn't fair.

Returning to your original point: I've been working on Firefox's memory consumption for about three years now. There are quite a few people who take your viewpoint. But there are also plenty of people who care very deeply about memory usage. Some of this makes sense, e.g. from people who are on low-end machines. But some of it is less rational... there is a subset of people for which memory consumption is almost a moral issue, and excessive usage indicates the general decay of western civilization, or something like that.

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

#62
post #19

Wouldn't the solution involve allowing plugins to manipulate the content of a page before it is parsed by the browser? There used to be a proxy adblocker that did that, but I don't think it works anymore. The Kindle browser uses a proxy to pre-render pages on the server in order to lighten the load of the device. Could AaaS (Adblock as a service) be a viable business? I think I'd pay for it.

You do have some information in the browser you can't get to from the outside. For example, the filter with the most hits for me is "@@||192.168.$xmlhttprequest", which whitelists XMLHttpRequests to 192.168.*. A proxy can't really tell the source of a HTTP request. But that kind of thing is sometimes the only indicator telling the difference between an ad and useful content.

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

#63
post #19

Wouldn't the solution involve allowing plugins to manipulate the content of a page before it is parsed by the browser? There used to be a proxy adblocker that did that, but I don't think it works anymore. The Kindle browser uses a proxy to pre-render pages on the server in order to lighten the load of the device. Could AaaS (Adblock as a service) be a viable business? I think I'd pay for it.

Privoxy - http://www.privoxy.org/ does just this and works very well when configured properly. It's also one of the few ways to reliably block ads on iOS apps.

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

#64
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…

Does HTTPSB have a keyboard interface? I just installed it and it seems great, but I'd prefer to not use the mouse. E.g. NoScript has Ctrl+Shift+\ to temporarily whitelist the current page's domain and Ctrl+Shift+S to open the drop-down, and the drop-down works well with the arrow keys.

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

#65
post #50

Earlier quoted context omitted.

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.

In my experience, JS memory usage is nearly always much higher than DOM. For example, my current Firefox session has 16 tabs open and ABP enabled. JS memory usage is over 600 MiB, whereas DOM memory usage is only 120 MiB.

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

#66

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.

However you can block specific HTTPS sites with privoxy. Admittedly this isn't very fine-grained but I use it to block a lot of crummy HTTPS ads and trackers.

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

#67
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?

I once read an explanation of memory usage. It boils down to images, if you think about it a PNG file is small but when you decompress that to a native bitmap for rendering to a screen, you've suddenly consumed a lot of space. A lot of applications render using the CPU and pass the data to the GPU to display. Now look at a typical page with images, flash (with images inside) all of the scroll and developers that don'…

It's pretty rare that I want an application to use less ram these days, if anything I wish more programs would take full advantage of it.

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

#68
post #59
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.

the point for me is the visual noise, not the memory that ads consume. Actually, normal users are used to the lag, they don't see it as much as we do. You can take a look at consoles that have run games at 30fps for decades and nobody complained.

I don't care about the "visual noise" of normal/banner-type ads - the real problem are those fucking layer ads with confusing icons (the X is the left one, the maximize button the right one), so if you want to read the content, first find out which type of layer ad it is, try to spot the 2x2px hotzone for the close button and THEN read the content.

People install adblockers because too many idiots became too fucking greedy and ruined ads for everyone else!

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

#69
post #40

Earlier quoted context omitted.

And who would want to use a browser anywhere other than a PC, right?

We appear to be talking about ABP on desktop firefox, no?

The problem surely applies just as well to ABP on mobile Firefox?

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

#70

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…

I tried switching to Privoxy the other day. You have to manually convert AdBlock lists to their configuration format, so it's less convenient. On top of that, some sites no longer worked and browsing generally felt slower. I think in the end doing the filtering in a native (C) program is the way to go, but right now it's not comparable to how hassle-free ABP is.

Yeah, the config is horrible IMO. A packaged privoxy install with ABP-comparable rules would be very useful.

I've never tried converting ABP rules into privoxy, but I did write a crude perl script to grab Ghostery's blocks and convert them into privoxy config files.

Post reply on HN