6

I recently came across the MVPS hosts file and became fascinated with the concept of blocking ads upstream from your browser. I don't know much about how quickly adblockers work, nor how quickly the hosts file can operate.

Would I get any noticeable speed boost by using that hosts file and disabling the adblock browser plugin?

EDIT: Just a quick update - I tried it, and it seems to be much quicker with the edited hosts file, if you can tolerate things like this:

enter image description here

This showed up on the Youtube homepage, I'll perform further testing to see if these are particularly prevalent.

3
  • Hmm... I would say it would depend on the specific implementation of the adblocker. But if it denies the requests to download the ads or redirects them to localhost, then there shouldn't be any noticeable improvements. Dec 9, 2013 at 19:20
  • Even better, don't mess around with your hosts file instead run a local caching DNS server that blocks the domains.
    – Zoredache
    Dec 9, 2013 at 20:19
  • You can use edexter which can replace those annoying dns server errors with a 1x1 white pixel. Edexter is basically a local http server that host any requests to localhost 127.0.0.1 with the 1x1 pixel image
    – Sun
    Nov 30, 2014 at 7:37

4 Answers 4

9

Blocking via the hosts file is almost certainly going to be faster just because it's much more limited in capability -- basically, you can only block based on hostnames. Ad blocking extensions can implement fine-grained blocking based on URL paths and parameters, as well as many other properties.

Host blocking will also tend to be faster because it's implemented in the operating system using a lower-overhead language (C or C++), compared to a JavaScript-based ad blocking extension.

A reasonably powerful computer probably won't have much of a problem with a real ad blocker, but if you're on a lower-end computer, host blocking could be significantly faster. So overall, you'll just need to test both and see what works best for you.

2
  • 1
    I tested it, and I'm definitely getting a boost, even though my computer is pretty quick already. Pages seem to be displaying in a snappier way.
    – Cyclone
    Dec 9, 2013 at 19:45
  • I can confirm that on a low RAM computer Host Blocking makes the browser feel much snappier than Adblock as Adblock loads a massive stylesheet into each browser tab to remove the adverts, and this adblocking style sheet can consume a lot of RAM.
    – Matthew
    Jan 13, 2021 at 1:59
3

While the hit in performance is negligible for most modern computers, under certain circumstances (old computers, multiple VMs) the memory hit is rather significant.

Using the Adblock Plus extension can add 60MB of memory use per Firefox process, in addition to 4MB per iframe. Under certain edge cases it can use up to 2GB of memory, which is unacceptable even for modern computers. This is not a fault of ABP's coding, and cannot be trivially fixed. https://blog.mozilla.org/nnethercote/2014/05/14/adblock-pluss-effect-on-firefoxs-memory-usage/

This has also been confirmed by the author of Adblock Plus. https://adblockplus.org/blog/on-the-adblock-plus-memory-consumption

The issue mentioned by the author above (Firefox duplicating memory when ABP is used) has not yet been fixed (or even assigned) as the time of writing (Oct 2014).

Anecdotal result: Disabling Adblock Plus on a VM that I am running reduced the memory consumption from ~220MB to ~140MB (assuming a freshly booted VM and Firefox browser loading the same page), which is a significant decrease. Whether it is worth it or not is completely up to your computer requirements.

1

Using Adblock has a negligible impact on startup performance. (+250 milliseconds) Hard statistics on performance while browsing are harder to come by, but I can say anecdotally that it is considerably faster than browsing without any ad blocking method.

The hosts file is almost certainly faster seeing as it is baked into the OS and is doing something quite simple. On the other hand, Adblock probably stops more ads and requires less upkeep. If you have anything like a modern system, I don't think that the difference between the two would be noticeable to human perception. You are better off choosing based on other factors such as which one is easier to use, or blocks more ads.

2
  • Could be a placebo then that browsing feels quicker, I'll have to perform extended testing I suppose
    – Cyclone
    Dec 9, 2013 at 19:50
  • Indeed, if you don't actually time it, these types types of things are irritatingly hard to measure with any authority.
    – David
    Dec 9, 2013 at 19:54
1

The fastest is to redirect the domains you wish to block to a web server that will reply with a blank page, this can be done by using a DNS server on your router that will redirect bad host to a blank page and make your computer use your router's DNS server. Having a service servicing a blank page is faster than waiting for the browser to wait for your request to time out and show an error of some sort.

Using ads blocker extensions or on computer hosts file consume resources on your computer that could have been used elsewhere.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .