
Show HN: Where Adblock+ injects 20K CSS rules, HTTPSB injects one - gorhill
https://github.com/gorhill/httpswitchboard/wiki/Adblock-Plus-memory-consumption
======
zorbo
HTTPSB just isn't userfriendly enough for me. I run Adblock (not plus though)
+ Ghostery, and perhaps they use more memory and CPU, but if they do I've
never noticed nor cared about it. Their userfriendliness is amazing though.
HTTPSB randomly cripples sites, much like NoScript, and I really can't be
bothered to deal with that anymore.

With Adblock + Ghostery I feel completely in control. If I want to enable the
Disqus script on a single page for a single session, Ghostery easily lets me
do that. HTTPSB makes that hard, or perhaps I'm missing something.

Case in point: When I tried to post this comment, I got a "Dead link: users
don't match" error which went away when I disabled HTTPSB.

~~~
sabret00the
Sorry to be slightly off-topic, but since you mention NoScript and are
familiar with that, this (HTTPSB) and ABP, can I ask. Is HTTPSB more of a
NoScript alternative or an ABP alternative?

~~~
zorbo
From the little experience I have with HTTPSB, I'd say that it _was_ more of a
NoScript alternative. It feels to me like a webbrowser firewall. They seem to
have moved into the adblocking field now though. Here's how I see it:

* Adblock (Plus): Blocking ads, No / minimal user action required

* NoScript: Blocking scripts. Lots and lots of user action required.

* Ghostery: Block privacy intrusions. Basically an application-level firewall for the browser. In a normal firewall, you'd block e.g. port 80 from IP x.x.x.x. In an appliction firewall you simply block, for instance, bittorrent traffic. Minimal user interaction required, and where it is required, it's very easy to use.

* HTTPSB: A low-level web browser firewall ("block port 80 from IP x.x.x.x) that now also does (better) adblocking. The adblocking is on par with Adblock (plus): no user action required. The browser "firewall" is basically unusable. Lots of user interaction required, and when it is required, it's basically impossible to understand.

~~~
Justsignedup
Sounds a lot like we need some volunteers to build a better UI for simple
(adblock mode), a 2nd option to do a noscript equivalent, and a 3rd option for
wild-west-browser-firewall mode.

------
rwallace
Given that advertising pays for a lot of the services we all use, the use of
Adblock and similar programs constitutes defection in game theory terms - the
more people who do it, the worse off we all are - which means even if you
choose to do it yourself (I personally don't), it is against your interests to
encourage other people to do it.

Also, given that computing is one of very few areas of technology in which our
species is still making substantial progress, and that progress is driven by
market demand, even if you want to make your workload computationally cheaper
for yourself, it is very much against your interests to encourage other people
to follow suit; if every web browser starts using less memory, everyone is
worse off.

I'm not going to start trying to persuade you personally to cooperate rather
than defect - that's a value judgment you have to make - but please at least
appreciate that it's a bad idea to encourage other people to defect!

~~~
joosters
Banksy says it best:

 _People are taking the piss out of you everyday. They butt into your life,
take a cheap shot at you and then disappear. They leer at you from tall
buildings and make you feel small. They make flippant comments from buses that
imply you’re not sexy enough and that all the fun is happening somewhere else.
They are on TV making your girlfriend feel inadequate. They have access to the
most sophisticated technology the world has ever seen and they bully you with
it. They are The Advertisers and they are laughing at you._

 _You, however, are forbidden to touch them. Trademarks, intellectual property
rights and copyright law mean advertisers can say what they like wherever they
like with total impunity._

 _Fuck that. Any advert in a public space that gives you no choice whether you
see it or not is yours. It’s yours to take, re-arrange and re-use. You can do
whatever you like with it. Asking for permission is like asking to keep a rock
someone just threw at your head._

 _You owe the companies nothing. Less than nothing, you especially don’t owe
them any courtesy. They owe you. They have re-arranged the world to put
themselves in front of you. They never asked for your permission, don’t even
start asking for theirs._

~~~
StavrosK
The salient part is "public space". Websites aren't public space.

~~~
EvanAnderson
A website displays on _my_ computer. I should have more control over that
"space" than a "public space", for sure. There's nothing wrong with wanting
complete control of how my computer is being used.

If the business model of the advertisers requires that they trust that my
computer displays their ads then I see it as their fault for misplacing their
trust.

~~~
freyr
> _A website displays on _my_ computer. I should have more control over that
> "space" than a "public space", for sure. There's nothing wrong with wanting
> complete control of how my computer is being used._

Who cares if it's _your_ computer? It's _their_ product or service you're
using, which is offered to you under well-defined terms of use. You're free to
not use it if you don't agree with the terms of use.

Let's assume that breaking the terms of use _is_ illegal or immoral. Then how
does doing it on _your_ computer absolve you of responsibility? A person's
basement is also _his_ private space. Should he have free reign to hold people
there against their will? Having a private space doesn't give you carte
blanche, especially when other people are involved (e.g. the people who built
the products or services you're using).

> _If the business model of the advertisers requires that they trust that my
> computer displays their ads then I see it as their fault for misplacing
> their trust._

The essence of your argument is that whenever you can screw somebody over and
they're powerless to stop you, it's their fault when you screw them over. This
is not an argument I'd be proud to make.

By this logic, a local convenience store that hasn't installed security
cameras is at fault when you steal from them, because they misplaced their
trust in their customers. A woman walking alone at night is at fault when
someone attacks her, because she misplaced her trust in society.

By the way, I use AdBlock. But I don't think your attempts at ethically
justifying AdBlock hold any water.

~~~
sp332
The site sends a bunch of data to my computer. My computer can choose to
render it or not, and make further requests e.g. from ad servers or not. If a
bunch of people show up at my house and I only let some of them into my
basement, that's not the same as kidnapping!

------
Walkman
MY GOSH! I never realized how ______slow my page loadings were. Removed ABP
(and a couple of extensions) after reading this and the memory consumption
just went to 1 /2 of what it used to be, the page loading times are just
incredible... I always wondered why Chrome is soooo much slower compared to
Firefox (ABP not installed on Firefox) but never investigated further. Thank
you so much!

~~~
pkulak
I'm a big fan of Privoxy. Just get that stuff out of the browser entirely.

~~~
jrabone
Yep. I run Privoxy and a DNS resolver configured to be authoritative for the
worst 5000 or so ad farms. Zips along nicely, and works for every machine on
the LAN or via remote VPN.

Fuck ads. Find a different business model.

------
Sarkie
The thing with all these plugins, I shouldn't care as a user, I should be
informed about these issues.

If you use [http://www.sublimetext.com/](http://www.sublimetext.com/) you will
get a dialog when scripts are running slow, as in, "Script XYZ took more than
1 second to process this file, you can disable it"

All I want in FF or Chrome is the same.

"Adblock blocked the UI for 4 seconds" "Adblock increased memory consumption
by double"

Or they could even be more harsh and kill plugins that take too long and
impact user experience like the Flash timeout.

~~~
enscr
Chrome shows the memory consumption of plugin here : chrome://memory-redirect/

I don't think most users want pop-ups about technical details in browsers.
Sublime text is a different story - it's meant for tech folks.

~~~
kevingadd
Plugin memory usage tracking is only realistically possible for Chrome where
plugins run in a sandbox with a really limited API. Even then, if the plugin
manages to allocate memory inside a page's sandbox (for example, by injecting
some CSS or JS in there), the reporting will be wrong.

The adblock plus problem is in fact one of those - it injects styles into
pages in order to filter ads, which increases the memory footprint of the
page. So neither Firefox nor Chrome can tell you 'adblock plus is increasing
memory usage by X', because the memory usage is hidden along with everything
else owned by the page, not by the addon.

~~~
cpeterso
Firefox is adding "add-on compartments" (bug 990729) that allocate separate
memory arenas for each add-on. Firefox will be able to use this information to
track (most) memory usage for each add-on.

[https://bugzilla.mozilla.org/show_bug.cgi?id=990729](https://bugzilla.mozilla.org/show_bug.cgi?id=990729)

~~~
nnethercote
It can already measure some parts of add-on memory usage, and you can see this
by looking for "add-ons" in about:memory. Bug 990729 will improve the accuracy
of the measurements.

~~~
Spittie
There is also this addon ([https://addons.mozilla.org/en-
us/firefox/addon/about-addons-...](https://addons.mozilla.org/en-
us/firefox/addon/about-addons-memory/)) which has a somewhat nicer interface.

------
sillysaurus3
Adblock+ has been fine for me. Has anyone had any problems?

Personally, Adblock+ has earned my trust over a long period of time, so it's
hard to see myself switching to something else unless the reason was dire.

~~~
mkesper
Trusting Adblock is hard because of the "acceptable ads" feature.
[https://en.wikipedia.org/wiki/Adblock_Plus#Controversy_over_...](https://en.wikipedia.org/wiki/Adblock_Plus#Controversy_over_ad_filtering_and_ad_whitelisting)

~~~
zorbo
As far as I know (anybody please correct me if I'm wrong on any of this), it's
Adblock PLUS that can't be trusted. Adblock (without the plus) is a completely
separate project that's much more trustworthy. Adblock PLUS basically usurped
Adblock by appending a "plus", making it seem like it's somehow better than
Adblock.

~~~
Spittie
It's not like that. A long time ago (2005?) there was an extension for Firefox
called "Adblock". Eventually the development of this extension died, and it
got forked with the name "Adblock Plus" in 2006 or so.

The Adblock you're referring to (the Chrome-only extension, right?) was
published in 2009. As you can see, Adblock Plus predates it by 3 years or so.

~~~
zorbo
Good to know, thanks for the correction.

------
deathanatos
Could someone explain _why_ Adblock injects CSS rules into the document? I
presume it's to hide the ads, but what I don't understand is why that's the
way it hides the ads. Why not simply remove the element containing the ad¹
instead? Additionally, presuming my earlier assumption is correct, if you hide
the element with CSS, doesn't the browser still need to fetch the ad?

¹Get rid of as much crap ad HTML as possible. Ads seem to come layered in all
manner of divs and iframes.

~~~
lauriswtf
What other options do you see? Searching and manipulating DOM in JavaScript
wouldn't be faster than a single CSS stylesheet. Remember that there are >20K
rules in play.

~~~
drdaeman
20K rules probably isn't that big, when you compile that to an automata. Most
nodes are probably behind the edges that never traversed.

If there would be an option for a extension to hook into DOM element creation
(i.e. when browser parses HTML and builds a tree, it'd call some user-defined
predicate function) - that would possibly solve the issue.

I believe CSS is slow because of cascading nature - it requires re-compiling
it from the very plaintext source on every page view, to combine ad-blocking
rules with others - this certainly could be optimized (if browser side would
provide tools for that). No idea about horrendous memory usage, though.

------
rmccue
Is there any plan to port this to Firefox? It'd be nice to see HTTPSB as an
alternative to ABP there too.

~~~
JetSpiegel
[https://github.com/gorhill/httpswitchboard/issues/86](https://github.com/gorhill/httpswitchboard/issues/86)

------
laurent123456
To reduce the number of filters in Adblock, a simple way is to let it run for
a few days with a popular black list such as EasyList. Then open the list in
the preferences, sort it by number of hits, and unselect all the filters with
0 hits (there are so many of them, that probably something like 99% of them
never get any hits). You can select the filters, and press "Space" to disable
them all in one go.

------
drdaeman
Apples and oranges.

ABP filters out (or, more correctly, modifies by styling them to not display)
DOM elements, HTTPSB filters out HTTP requests. That's two completely
different approaches, each with its own pros and cons, but neither is a real
replacement for the other one (although both apples and oranges are suitable
for eating).

On an unrelated note, a fun approach to fix ABP would be to introduce non-
cascading style sheets, possibly with limited styling capabilities,
specifically for adblocking. Those could be well-precompiled and run extremly
fast while taking much less memory. But that would require hacking browser
internals, so that's not gonna happen.

------
AndrewDucker
Okay, so how can we get the ABP people to do likewise?

I'd love to see a reaction from them explaining either why they can't do it,
why it wouldn't help, or when they're planning on doing it...

~~~
notfoss
Wladimir Palant(ABP dev) gives a short response here:

[https://adblockplus.org/blog/on-the-adblock-plus-memory-
cons...](https://adblockplus.org/blog/on-the-adblock-plus-memory-
consumption#c005360)

------
anigbrowl
I have not had any significant problems with ABP, but after trying out HTTPSB
earlier this week it's become my most essential extension. It's not as user-
friendly as Ghostery, ABP and a few others, but I really appreciate its
ability to quickly show me what's actually happening on a given page. I would
love to see it develop into a general-purpose diagnostic tool. After only
having it installed for a few days, it's hard to imagine life without it -
which is about the highest compliment I can give.

~~~
e1g
Same - I installed HTTPSB as a dec tool, but ended up liking how much control
it gives back to me about what is loaded on my pages. There was an initial
period of frustration as I had to unblock the bare minimum required to make
youtube/gmail/vimeo/facebook work as expected, and after that it's smooth
sailing. ADP is gone, and I _feel_ like I get my pages quicker and cleaner.

------
baal80spam
Dear god... Why haven't I found this plugin before? This is pure awesomeness -
makes up for lack of NoScript for Chrome...

I can finally disable ABP and Disconnect - ever since I used them, my web
experience in general felt definitely more sluggish.

Thanks!

------
randunel
The only reason I'm using an ad blocker is because of Youtube's ads. I think
the whole marketing industry took a big hit when Google introduced ads to
Youtube, because lots of people were forced to install the ad blockers. All of
my friends use ABP now......

------
guelo
Not sure how a Chrome-only plugin is supposed to help with Firefox memory
consumption.

~~~
pritambaral
By setting an example of how element-hiding blocklists should be implemented

------
antiufo
As a temporary workaround for AdBlock (and for Firefox since it's not
supported by HTTPSB), here's EasyList stripped out of all its CSS rules. It
obviously lets some banners slip through, but most of them are still blocked.

[http://www.xamasoft.com/adblock/easylist-
nocssrules.txt](http://www.xamasoft.com/adblock/easylist-nocssrules.txt)

------
D9u
With AdBlock+ and HTTPSB you still get the network traffic from unwanted
sites.

AdSuck, from the good folks at Conformal, blocks unwanted connections and thus
decreases unwanted network traffic.

[https://github.com/conformal/adsuck](https://github.com/conformal/adsuck)

------
maratc
I solve the issue with a (free) OpenDNS account where everything in the
(crowd-sourced) "Advertisers" list is just resolved to 127.0.0.1. This works
for phones, tablets, and any browser on any OS in my home network.

The problem is what to do once I leave my home network.

------
specto
I like it, though every once in a while something will be blocked in the
middle of the screen and I can't dismiss the red blocked area to get to the
actual content.

------
phaed
Prepare for the huge spike of user adoption. This is just incredible, never
knew this existed. Super useful.

------
bikamonki
Why bother installing an ad blocker if your brain already has an ad ignorer
plugin? Furthermore, this ad ignorer software is quite good at learning: the
advertirzers may shift place and shape but it will only fool you once, or
none. Hence the need of massive user bases on 'free' online services, because
only a tiny percentage of brains fall for the ads and even a tinier chunk of
these clickers turn into buyers.

------
forrestthewoods
I rage quit Firefox years ago because it's impossible to discuss it's critical
perf issues without people pointing shifting blame to plugins. It got so bad I
ran clean installs that never had a plugin ever, still had perf issues, and
people on the internet simply refused Firefox could be at fault.

I switched to Chrome and have never looked back. I also have never had a
single issue with any AdBlock plugin in Chrome. Maybe they're doing something
insanely stupid. I don't know. I use Chrome where it just works so I also
don't care.

~~~
jacobolus
Once you get past about 30 tabs, Chrome performance drops through the floor
while memory usage just balloons; by contrast, both Firefox and Safari hold up
pretty well. That, plus sending every keystroke in the URL bar to Google, and
a bunch of really quirky UIs that I deeply dislike, keeps me from using Chrome
for anything but testing.

Edit: This seems to be a controversial comment. I’m curious whether folks
disagree with me that Chrome doesn’t work very well for many tabs, or if they
think that’s irrelevant to the discussion, or what?

~~~
shanelja
I don't think I've ever had the need for 30 tabs; the magic of the internet is
that if I ever need to see a specific website, I can just type in a URL.

~~~
__david__
I use tabs/windows as a todo list. I have 84 tabs open in my main window, and
36 windows open. Mostly I have 1 window per task, each with a few to a dozen
tabs of related stuff. When I complete a task (or decide not to pursue it) I
close the window.

It's not the best way of organizing, but it actually fits my ADD/scattershot
style of working pretty well.

~~~
test1235
I'm interested - what are each of your to-dos? Are they like, articles to read
or are they actually specific pieces of work, say like, a wordpress page to
edit?

~~~
__david__
I won't list them all, but here's a selection:

A hobby web site I was editing where I got stuck on some css, a (long) video I
want to watch, research for an audio program I'm designing, data about an
electronics hobby project I want to start, 2 pull requests I need to follow up
on, an appliance I need decide on and buy for my kitchen, a web forum I need
to integrate into a site of mine, a couple bug reports I need to follow up on,
an amazon page of a video game I heard was worth my time, etc.

So...just random stuff. Some are personal, some are professional, some are
home related, some are just key nuggets of info to remind me of something I
want to look into at some point.

