10 ms·
How the most popular Chrome extensions affect browser performance
- visarga 6y agoCool, but it doesn't matter that no-extension is much faster because we can't browse without ad blocking. Even if it slows the page, it is still preferable. On the other hand ad blocking wastes less bandwidth and memory.
- laurent123456 6y agoI don't think you read the graph right. Without ad-blocking extensions, the browser is of course much slower, about 15 times slower according to their tests.
- londons_explore 6y agoI am doubtful of some of the numbers here... I mean I know browsing the web without an ad blocker is bad, but it isn't 'takes 35 seconds to load an article on gigabit ethernet' bad....
- smichel17 6y agoThat was a graph of cpu time, not network request time, and 20s of the 30s were spent parsing and running js.
- jeffbee 6y agoThe chosen site for that test is basically a worst-case. It uses a local TV news site. These are all cesspits. They have banners, auto-playing videos, popovers, clickjacking, the works.
- cornedor 6y ago> DuckDuckGo Privacy Essentials reduces the CPU time of the article page from 31s to just 1.6s. All other tested extensions also bring CPU time down to at most 10s. It doesn't even slow down the pages, the opposite is true here.
- IshKebab 6y ago> a website allowlist Ridiculous. It's even called whitelist in the code snippet.
- esperent 6y agoNot at all surprising that the worst two extensions by a long way are both from Avira. Yesterday I opened Chrome and received a warning that the Avira extension had been installed. I certainly did not install it willingly. I'm pretty sure I didn't install any other software that sneakily bundled it recently, either - I mean, I'm 99.9% sure that I haven't installed _any_ software in the past week. So how why did it suddenly show up? I reported it to Chrome from the web extensions store. Highly unlikely that they'll do anything about it though.
- sp0rk 6y ago> So how why did it suddenly show up? If Avira has a pay-per-install program, I would say it's pretty likely that you're part of a botnet.
- esperent 6y agoInteresting. I ran every kind of virus test I could find about a month ago since I was getting weird display/jank issues. Couldn't find anything, and in the end I tracked the issues down to a windows display scaling error. Any idea how I would go about testing for a botnet?
- arprocter 6y agoI've seen resetting Chrome fix all sorts of weirdness: https://support.google.com/chrome/answer/3296214?hl=en https://support.google.com/chrome/answer/3296214?hl=en
- eyegor 6y agoResetting chrome isn't much of a solution if the underlying problem is botnet affiliation (trojan, rootkit, etc). Should be reasonably easy to shut down all applications and services, and inspect the traffic going through the router for suspicious domains. If you only have a windows machine connected there should only be Microsoft traffic and maybe the router manufacturer. Anything else, and it's probably malicious.
- londons_explore 6y agoAll the tests were done on an n2-standard-2 gcp instance... That doesn't have a GPU. Rendering a webpage without a GPU uses a lot of different codepaths and isn't awfully representative of performance with a GPU.
- mostlystatic 6y agoI ran most of the tests on example.com, which is easy to render without having a GPU available. Looking at on-page CPU time for Evernote, 91% is spent just processing JavaScript or HTML. So I expect any benefit of a GPU to be minimal.
- londons_explore 6y agoBut there might also be a performance hit with a GPU... There are various antipatterns like drawing on a canvas and then reading back the pixels repeatedly that perform atrociously with a GPU (due to the latency between the CPU and GPU). Some sites do a lot of that for things like custom font rendering, fingerprinting user hardware, custom data decompression algorithms that use canvas, etc.
- hoten 6y agoLab analysis is always going to have compromises. What's important is the relative change (without and with the extensions), and that the extra work isn't especially slowed down because of lack of GPU.
- the_duke 6y agoThis is a worthy research topic. On mobile, with slower networks and much worse CPUs, uBlock often completely changes the experience. (thanks Mozilla!) I would note though that only example.com was examined (and apple.com in one test). I also did not see information if tests were repeated, as no variance/stddev is given. I'd expect it to be pretty high.
- mostlystatic 6y agoI ran the tests 7 times and then took the median. I'll look into quantifying variance more, but for now here's a boxplot for total on-page CPU time. https://gist.github.com/mattzeunert/de3c8aedd2936a34eeb88b62b985ff13#gistcomment-3343338 https://gist.github.com/mattzeunert/de3c8aedd2936a34eeb88b62... I ran tests on example.com, apple.com, and a WCPO news article (for the ad blocker tests). The biggest performance issue is that extensions just dump large scripts into pages indiscriminately. Most of the time extensions don't do anything differently based on the content of the page. I also tested a WCPO news article to see the impact of ad blockers. I picked a local news website specifically because they contain a lot of ads. If a page doesn't have any ads the performance impact of an ad blocker will be slightly negative. What my tests don't pick up is extensions that only run a certain domains. For example, if you run Honey on a shop they support I expect the CPU consumption to increase a lot more. I wrote a similar article last year, which tests a few other pages as well: https://www.debugbear.com/blog/measuring-the-performance-impact-of-chrome-extensions https://www.debugbear.com/blog/measuring-the-performance-imp...
- the_duke 6y agoThanks for the info (and the research in general). The boxplot looks encouraging (as in, the variance doesn't seem too relevant for drawing conclusions) I hope to use this as another source whenever marketing wants to add yet another tracker.
- darkport 6y agoHow are you installing Firefox extensions in mobile? Is it Android only?
- a_imho 6y agoMost ad blockers work by blocking certain network requests that are initiated by the page. DDG Privacy Essentials reduces the number of network requests by 95% and the download weight by 80%. DuckDuckGo Privacy Essentials reduces the CPU time of the article page from 31s to just 1.6s. All other tested extensions also bring CPU time down to at most 10s. It seems the single most important thing regarding Real Word Performance is a good content blocking functionality (not to mention other boons). Why don't browsers come with one by default?
- c17r 6y agoBecause the most popular browser is made by a company that makes the vast majority of their money from ads.
- rhythmofrest 6y agoFirefox does. https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop?as=u&utm_source=inproduct#w_what-enhanced-tracking-protection-blocks https://support.mozilla.org/en-US/kb/enhanced-tracking-prote...
- a_imho 6y agoIt blocks some tracking, but is it a good content blocker? Last time I checked I still needed to install ublock or equivalent for acceptable performance. How hard it is to incorporate something an extension already provides?
- PaywallBuster 6y agoI've seen ublock causing CPU to be pegged at 100% making various js heavy applications completely unusable. https://github.com/uBlock-LLC/uBlock/issues/1829 https://github.com/uBlock-LLC/uBlock/issues/1829
- pirsquare 6y agoGreat research! I'm a user of evernote web clipper and seeing that they're adding 3mb to every page that I'm using is extremely discouraging. My browse to clip ratio is around 1000:1 and I'm probably removing the extension after this. Just wondering, can browser extensions codesplit their bundles? If it's possible, then it is really disappointing to see these large companies loading huge bundles on initial load.
- Lex-2008 6y agoDid you try to set the extension to "run on click"? Right-click extension icon, "This can read and change site data" -> "When you click the extension". I didn't try it myself (it might require reloading the page), but might be an option for 1000:1 browse to clip ratio.
- pirsquare 6y agoAwesome - Didn't know about this trick. I'm reconfiguring most of the my extensions to this. Gracias!
- ptman 6y agoTIL. Would be wonderful to have this on firefox as well
- e40 6y agoI just tried it and it doesn't seem to work in Version 83.0.4103.106 (Official Build) (64-bit). When I clicked on EditThisCookie it said there were no cookies when it was set to "when you click this extension", but when I changed it to "all sites" it showed me cookies. Too bad.
- paulhodge 6y agoNothing stopping them from doing code splitting. Most extensions just modify the dom to insert script tag(s). So the performance strategies are the same as any other frontend app.
- glangdale 6y agoIt's entertaining that there is yet another area where "running large numbers of regular expressions, known in advance and not changing all that often" over lots of input is performance critical. This was a key driver behind writing Hyperscan (https://github.com/intel/hyperscan https://github.com/intel/hyperscan) which I used to work on when it was primarily used for network security (thousands or tens of thousands of regular expression rules for firewalls), but doing this for ad blocking seems pretty sensible too.
- rurban 6y agoHyperscan is still dynamic, and C only. Google or Mozilla could use perfect hashes and ship it. (Google won't). You need a native extension for a fast low memory blocker.
- pythux 6y agoThis is indeed a performance critical problem, but it is already pretty much solved at this point. If you look at the performance of the most popular content blockers, their decision time is already below fractions of milliseconds. So it does not seem like performance is really an issue anymore.
- glangdale 6y agoYeah, I don't doubt that it's solvable by other means (notably hashing). It's just amusing that something we started building in 2006 - and open sourced in 2015 - largely solves a problem directly (i.e. you don't specifically have to rewrite your regexes).
- pythux 6y agoTo be fair, blocklists are not really lists of regexps. They contain some regexps indeed but the syntax is mostly custom and matching relies on both patterns found in URLs (This part could be partially expressed as RegExps) as well as a multitude of other things like constraints on domain of the frame, domain of the request, type of network request, etc.
- SeanDav 6y ago> "DDG Privacy Essentials does a simple object property lookup based on the request domain, an operation that is practically instantaneous" This sounds interesting. A bit of searching is not providing much enlightenment - anyone care to explain in a bit more detail? Also, if it is so fast, why aren't all the filter add-ons doing it?
- PetahNZ 6y agoIts open source right? Could you not just look it up https://github.com/duckduckgo https://github.com/duckduckgo
- wereHamster 6y agouBlock Origin doesn't do much worse than DDG Privacy Essentials. A few percent perhaps? I'd say on par with it…
- esnard 6y agoWhen you have an array, it's way faster to check the existence of array[key], which is O(1), than to loop over the full array to find if one of the values match the one you're searching for, which is O(n). This is used in hash tables, for example: https://en.wikipedia.org/wiki/Hash_table https://en.wikipedia.org/wiki/Hash_table Object properties in JS are mostly the same thing. I guess other extensions can't do the same because they don't have a simple value to search in a whitelist, but rather a list of regex which must all be executed.
- gorhill 6y agoContent blockers in the same class as uBlock Origin ("uBO")[1] have the added burden of having to enforce generic filters which are independent of the request domains, they have to find a specific pattern in the request URL, including with support for wildcards. Even though, and despite this added burden, I will point out that uBO is almost as performant as DDG Privacy Essentials as per this report. Furthermore, uBO contains WASM modules but they are not used in the Chromium version of the extension since this would require to add a `wasm-eval` directive to uBO's extension manifest, something I prefer to avoid for the time being, I fear this would cause more lengthy validation of the extension by the Chrome Web Store. * * * [1] Able to enforce EasyList, EasyPrivacy et al.
- k__ 6y agoI like Grammarly, but the extension is really crappy.
- bvm 6y agoGrammarly causes a surprising amount of frontend issues.
- thomasahle 6y ago> The Avira Browser Safety extension contains a website allowlist with 30k+ regular expressions. When the user navigates to a new page Avira checks if the page URL is in that allowlist I wonder who thought that would be a good idea... Sounds like something that could be significantly improved by compiling all patterns into a single statemachine.
- kalleboo 6y agoThat's what Safari does for its ad blocker plugin API. Also allows for greater privacy since the browser can apply a static list and the plugin never knows what you sites you browsed to. Google is trying to move to enforce the same model but it's limiting in some ways and generated massive uproar.
- pythux 6y agoFYI: content blockers like uBlock Origin or Ghostery use block lists of tens of thousands of rules as well (can be up to 100k depending on lists enabled) and there are ways to make this matching very efficient[1]. [1] https://news.ycombinator.com/item?id=19175003 https://news.ycombinator.com/item?id=19175003
- aasasd 6y agoYeah, back when I was doing similar matching on a big bunch of regexes, it was vastly faster to match on all of them lumped together in a group with the ‘or’ operator. And I learned of this more than fifteen years ago from a server-side lib that deduced the exact browser from the user-agent: it had a huge regex with various placeholders and a long list of ‘if/elseif’ checks to extract the values.
- thomasahle 6y agoExactly. If your regex engine compiles to a DFA, you can have arbitrary many or clauses with no overhead. It's pretty neat.
- traspler 6y agoIt seems like the included pw managers like LastPass & Dashlane also impact page loading drastically. Is there even an alternative with less impact?
- edsimpson 6y agoAnecdotally, I noticed a browsing speed up when I switched from LastPass to Bitwarden on older laptops.
- pbhjpbhj 6y agoIsn't that weird - not a programmer but ... surely the only code they need to run on every page load is to add an event handler for forms to check if a login form has been focused? (At which point their add-on runs). What else are they doing?
- ricardojoaoreis 6y agoBrowser extensions are usually the attack vector for password managers. I use the native desktop apps for them, previously LastPass and currently Bitwarden. The UX suffers a bit but you at least you gain some security.
- njovin 6y agoI recently switched to Enpass after LastPass started having major issues in both Firefox and Chrome. I was having to remove and reinstall it at least once per week. Enpass has been great. The setup with Dropbox sync isn’t as quick but that’s just one per device. It’s very speedy and hasn’t gotten in the way at all.
- goalieca 6y agoI typically run a number of extensions: duckduckgo privacy essentials, ublock origin, privacy badger, and whatever built-in firefox has. Perhaps this is overkill but they all cover slightly different things.
- crazygringo 6y agoUtterly fascinating article. The main takeaways seem to be that 1) extensions in general wind up massively increasing CPU time (by 5-20x) when loading "example.com", and 2) ad blockers wind up massively reducing CPU time (by 4-20x) when loading a "WCPO news article". Which makes me happy that I use uBlock (edit: Origin, thanks below), and sad that I have to use LastPass. HOWEVER -- I feel like both these metrics are potentially highly misleading, because CPU time isn't something the user directly observes -- it might be the limiting factor, or it might not affect the user experience at all (because the CPU usage is happening while waiting for further network resources that are even slower, or the CPU usage is happening after the page has visually finished loading all relevant content). I'd be much more interested to see how extensions like Evernote or LastPass increase the time it takes for a real webpage (e.g. "nytimes.com") to finish painting the viewport not including ads, and similarly whether adblocking actually decreases the same -- or if all the advertising stuff really only happens afterwards. (Because sites are architected differently, you'd need to compute an aggregate score across a range of common sites.)
- gizmodo59 6y agoIn mac, there is sort by energy usage in activity monitor and Chrome always takes the top spot (at least for me).
- chromeinternalz 6y agoThe reason - Safari can delegate to linked in code that is allowed to take advantage of powersaving hooks in the OS, whereas, Chrome does the following: 1. Contact Google 2. Start to load page 3. Contact Google 4. Continue load page 5. Send more stuff to the big G 6. Maybe finish loading page 7. Why not send more stuff to Google
- catalogia 6y agoBesides energy usage reported by the activity monitor, there is also the matter of how long the a user can stay on battery power. For laptop users, energy usage can be a huge deal for their overall satisfaction, even if the user isn't quite sure where they're gaining or losing anything.
- iou 6y agoNice article. This seems like a relevant contrast to share here https://brave.com/improved-ad-blocker-performance/ https://brave.com/improved-ad-blocker-performance/
- lmkg 6y agoIt looks like a lot of the slowness from the slow extensions is from parsing and executing JavaScript. Are there opportunities from the browser side to make extensions faster? It seems like re-parsing the same JS on every pageload is an opportunity for gains from caching, but I'm also wondering about different delivery mechanisms like wasm. Are there security considerations here?
- aasasd 6y agoAlternatively, heavy code could be kept in the background script while page-injected scripts only do interaction. This would even employ the JIT properly.
- gorhill 6y agoAn note regarding the memory usage in Chromium and uBO specifically. I have observed that even though the memory usage as reported by developer tools under "JavaScript VM instance" stay rather stable in uBO[1] even after a lot of memory churning operations[2], the figure reported in Chromium's Task Manager keeps climbing up after each of these memory churning operation, and forcing garbage collection does not bring the reported usage down in the Task Manager. There is something happening in Chromium's extension process (and outside the JavaScript VM in which the extension run) which may cause wildly various memory figures for even the same extension depending on how much memory-churning operations have occurred -- I wish Chromium devs would provide technical insights about this. * * * [1] Around 8 MB when using default settings/lists. [2] For instance, repeatedly purging all filter lists and forcing an update.
- lifeisgood99 6y agoI just want to say thank you so much for uBO
- hoten 6y agocould you open a bug in https://crbug.com/ https://crbug.com/ and tag the extensions component?
- helltone 6y agoIf the author is here, can I suggest testing the Dark Reader extension too?
- fuj 6y agoI feel like the author would need a completely different scale for it. Pages load considerably slower with it, so much I’m considering just removing it.
- mostlystatic 6y agoHere are the test results for Dark Reader: https://www.debugbear.com/chrome-extension-performance-lookup?search=dark%20reader https://www.debugbear.com/chrome-extension-performance-looku... I also briefly mention it in the section on FCP, explaining why it makes sense for the extension to use render-blocking content scripts. https://www.debugbear.com/blog/2020-chrome-extension-performance-report#page-rendering-delays https://www.debugbear.com/blog/2020-chrome-extension-perform...
- erikrothoff 6y agoCool to see our extension tested (an RSS reader). What's great with this is that it gives us a metric to work towards improving. I've always been under the assumption that "cpu is cheap", but it does have real effects.
- baggy_trough 6y agoDon't ever install extensions. There is no limit to the trouble and pain they can cause.
- saagarjha 6y agoNever browse the web. There is no limit to the trouble and pain it can cause.
- WhompingWindows 6y agoCan someone give me an ELI5 on Privacy Badger? My current stack is just uBlock Origin, I'm considering layering PB over the top.
- identity0 6y agoIn my experience, PB pretty much does nothing. UBO already blocks trackers and social media buttons, and if it doesn’t, you can turn on those filters. PB doesn’t even block the trackers until it “learns” that they are trackers, it just avoids sending cookies (which doesn’t stop facebook from fingerprinting you.) The best method would probably turning off 3rd party scripts and iframes in UBO, but that does mean you have to un-break a lot of sites. An extension like cookie autodelete would also do much more than PB, since, if you have no cookies, they can’t be sent. Edit: I realized that I sound like I’m bashing PB too much. PB is definitely better than nothing, and doesn’t break any sites, but there are better things you can do which make PB obsolete.
- YippRino 6y agoI must confess that uBlocker surprised me.
- user2233 6y agohello
- salmo 6y agoI would be curious to see this for Firefox extensions as well.
- ChikkaChiChi 6y agoHas a browser team ever considered the possibility of creating allowlists for extensions only on certain websites? A native implementation of something like uMatrix that also worked on extensions could help end users at least remove slowdowns on sites they need to be performant.
- sizzle 6y agoAm I creating a bottleneck by running Ghostery with uBlock Origin?