News for hackers. Stuff that matters.
Re:How the most popular Chrome extensions affect browser per... by gorhill on Tuesday June 16, 2020 @11:51AM (#23540599)
An 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.

Re:How the most popular Chrome extensions affect browser per... by lifeisgood99 on Tuesday June 16, 2020 @12:26PM (#23541020)
I just want to say thank you so much for uBO
Re:How the most popular Chrome extensions affect browser per... by hoten on Tuesday June 16, 2020 @01:25PM (#23541672)
could you open a bug in https://crbug.com/ and tag the extensions component?
Re:How the most popular Chrome extensions affect browser per... by crazygringo on Tuesday June 16, 2020 @09:38AM (#23538979)
Utterly 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.)

Re:How the most popular Chrome extensions affect browser per... by mostlystatic on Tuesday June 16, 2020 @11:15AM (#23540112)
Good point about extension code running while rendering is still blocked by the network. That should prevent any user-facing delay.

I just ran a few quick tests with the Top 50 extensions and an NYT article. The charts are ordered by largest median metric value.

https://gist.github.com/mattzeunert/de3c8aedd2936a34eeb88b62...

The Largest Contentful Paint (LCP) chart suggests an interesting phenomenon. Extensions like Dashlane and Evernote appear to slightly increase when that paint happens. These extensions load a large amount of code, but don't block the initial render.

Grammarly does not seem to push up LCP much. Its JS code runs before the page starts rendering, so maybe it is less likely to compete with other code later on.

Normally running code before the page renders would be bad, but if the page is network-constrained at that point it might soften the impact.

Re:How the most popular Chrome extensions affect browser per... by crazygringo on Tuesday June 16, 2020 @11:30AM (#23540320)
Thanks. Very impressed not only that you took the effort to run those, but also at how quickly you responded and were able to run, collect and publish results! Major kudos.
Re:How the most popular Chrome extensions affect browser per... by notRobot on Tuesday June 16, 2020 @10:57AM (#23539873)
Just to clarify to readers who aren't aware, you should be using uBlock Origin and not uBlock.org: https://en.m.wikipedia.org/wiki/UBlock_Origin
Re:How the most popular Chrome extensions affect browser per... by sa46 on Tuesday June 16, 2020 @01:54PM (#23542000)
> I have to use LastPass.

I recently switched from LastPass to 1Password because of the added latency from Lastpass. Lastpass adds about 70ms to first contentful paint on example.com. 1Password, on the other hand, runs after the painting is done so it doesn't block rendering. I polished up a blog draft I had lying around about switching to 1Password: https://joe.schafer.dev/passing-lastpass/

> 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.

I reinstalled Lastpass to test on nytimes.com. It takes 58ms to evaluate onloadwff.js (the Lastpass entry point) before any content is rendered.

Re:How the most popular Chrome extensions affect browser per... by DaiPlusPlus on Tuesday June 16, 2020 @07:21PM (#23545556)
I have LastPass, but I keep it in “only activate extension when I click on the toolbar button”.

The only annoying thing is that LastPass requires the whole page to reload first - I don’t know why Chrome can’t load an extension into an already-loaded page.

Re:How the most popular Chrome extensions affect browser per... by tim333 on Wednesday June 17, 2020 @07:46AM (#23550270)
I switched to Bitwarden for similar reasons. Seems ok though I haven't checked the latency.
Re:How the most popular Chrome extensions affect browser per... by cridenour on Tuesday June 16, 2020 @12:20PM (#23540954)
I was surprised by the choice of WCPO, which to me is a local news station who owns WCPO.com. Does it mean something else I'm not aware of or are they famous for being slow?
Re:How the most popular Chrome extensions affect browser per... by mostlystatic on Tuesday June 16, 2020 @12:46PM (#23541230)
Local news sites tend to be extremely slow and ad-heavy in my experience. So I thought of a medium-sized US city, searched for "Cincinnati news" and picked the top result.

I found what I was looking for, this is the article I ran the tests on: https://www.wcpo.com/news/education/higher-education/miami-u...

Re:How the most popular Chrome extensions affect browser per... by cridenour on Tuesday June 16, 2020 @03:09PM (#23542874)
Ah that explains it. Thanks!
Re:How the most popular Chrome extensions affect browser per... by zerocrates on Tuesday June 16, 2020 @04:14PM (#23543512)
> CPU usage is happening after the page has visually finished loading all relevant content

This can be very noticeable though, leading to sluggishness, stuttering scrolling, slowing down other tasks, increasing fan noise on laptops. uBO in my anecdotal experience may almost make a bigger positive impact in this fashion than simply at the initial render.

Re:How the most popular Chrome extensions affect browser per... by gizmodo59 on Tuesday June 16, 2020 @09:48AM (#23539063)
In mac, there is sort by energy usage in activity monitor and Chrome always takes the top spot (at least for me).
Re:How the most popular Chrome extensions affect browser per... by mercer on Tuesday June 16, 2020 @11:06AM (#23539988)
I've been in power/battery-constrained situations and it's crazy how much Chrome drains my battery compared to Safari. I still use it when I'm sure I'll be able to charge soon, but I've gone as far as converting some of my home-made extensions to Safari for situations where I need to conserve what I can.
Re:How the most popular Chrome extensions affect browser per... by catalogia on Tuesday June 16, 2020 @10:35AM (#23539587)
Besides 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.
Re:How the most popular Chrome extensions affect browser per... by chromeinternalz on Tuesday June 16, 2020 @10:01AM (#23539226)
The 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
Re:How the most popular Chrome extensions affect browser per... by a_imho on Tuesday June 16, 2020 @07:30AM (#23537891)
Most 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?

Re:How the most popular Chrome extensions affect browser per... by c17r on Tuesday June 16, 2020 @07:41AM (#23537970)
Because the most popular browser is made by a company that makes the vast majority of their money from ads.
Re:How the most popular Chrome extensions affect browser per... by pjmlp on Tuesday June 16, 2020 @08:52AM (#23538518)
And to large extent, the same developers that complain about ads are the ones to blame that Chrome has reached that market leadership.
Re:How the most popular Chrome extensions affect browser per... by Cthulhu_ on Tuesday June 16, 2020 @07:46AM (#23538003)
And the other browsers are sponsored heavily by said company - either financially or technologically.
Re:How the most popular Chrome extensions affect browser per... by rhythmofrest on Tuesday June 16, 2020 @07:56AM (#23538077)
Re:How the most popular Chrome extensions affect browser per... by a_imho on Tuesday June 16, 2020 @08:56AM (#23538580)
It 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?
Re:How the most popular Chrome extensions affect browser per... by pbhjpbhj on Tuesday June 16, 2020 @10:30AM (#23539521)
Not hard at all, they could include uBlock add-on by default (as they did with Pocket) except allow people to disable it this time.

They do rely on Google's advertising revenue for multiple $100M of funding; so they presumably don't want to be too successful in democratising ad-blocking.

Eich used to be a controlling influence on FF (as Mozilla CEO), since he was ousted he heads Brave browser which includes content blocking by default (and a content revenue model).

In short perhaps FF/Mozilla are curtailed by financial considerations.

Re:How the most popular Chrome extensions affect browser per... by TheRealPomax on Tuesday June 16, 2020 @02:58PM (#23542768)
Not unless they buy uBlock first, which is what they did with Pocket. And unlike Pocket, which was already a company looking to get bought, uBlock is very much not that.
Re:How the most popular Chrome extensions affect browser per... by pythux on Tuesday June 16, 2020 @04:40PM (#23543797)
Nit: you must be talking about uBlock Origin, because uBlock was actually bought[1].

[1] https://blog.getadblock.com/the-adblock-family-gets-a-new-ad...

Re:How the most popular Chrome extensions affect browser per... by behnamoh on Wednesday June 17, 2020 @12:32PM (#23553324)
But even Brave doesn't block some google ads.
Re:How the most popular Chrome extensions affect browser per... by eli on Tuesday June 16, 2020 @01:34PM (#23541782)
Aggressive content blockers also tend to break websites. Not big sites like Washington Post for very long, but all sorts of small sites and in confusing ways.

For example, we had to rearchitect part of our site that was talking about marketing and advertising because various ad blockers decide any url pattern with '/advertising/' shouldn't be loaded.

Re:How the most popular Chrome extensions affect browser per... by Flenser on Wednesday June 17, 2020 @04:25AM (#23549121)
We had to rename our cookie police modal so unlock users could get into our app.
Re:How the most popular Chrome extensions affect browser per... by Wowfunhappy on Tuesday June 16, 2020 @07:26PM (#23545596)
Because a web browser should be fundamentally neutral by default. All content should get rendered the same way, regardless of which server or domain it comes from.

That doesn't preclude the browser from making choices to protect privacy and security, but all sites should be treated equally (as Safari does with its tracking protection, for instance).

Re:How the most popular Chrome extensions affect browser per... by a_imho on Wednesday June 17, 2020 @05:38AM (#23549546)
I don't think I agree with that. Do you want spam treated the same as your regular email for example? It is up to the implementation to decide what is {spy|mal|track|junk}ware.

The reverse is also problematic, sites treat browsers (or even user agents) very differently. Why should browsers not do the same?

Re:How the most popular Chrome extensions affect browser per... by Wowfunhappy on Wednesday June 17, 2020 @12:17PM (#23553143)
For email, I agree some sort of spam filtering is necessary—but I wouldn't want an email client to alter the contents of messages depending on who the sender is. (By default at least—customization through plugins is great!)

> Sites treat browsers (or even user agents) very differently. Why should browsers not do the same?

But isn't that exactly why browsers are now phasing out user agents? I'm all for that—I shouldn't have to fake my user agent in order for Slack to work in a mobile browser.

If there's a certain browser feature that a website needs, and the website detects this feature isn't present and changes its behavior accordingly, that's quite different!

Re:How the most popular Chrome extensions affect browser per... by joshmanders on Tuesday June 16, 2020 @09:13AM (#23538749)
Brave Browser is Chrome with that built into it.
Re:How the most popular Chrome extensions affect browser per... by tempodox on Tuesday June 16, 2020 @09:36AM (#23538965)
... and that inserts its own spam: https://news.ycombinator.com/item?id=23442027
Re:How the most popular Chrome extensions affect browser per... by pbhjpbhj on Tuesday June 16, 2020 @10:35AM (#23539593)
Can you back that statement up. You're saying that Brave inserts spam content in to pages? Do you have examples?

Never seen that myself in my time using Brave.

FWIW I quite like the BAT and affiliate link model and was made aware of both prior to my install.

Re:How the most popular Chrome extensions affect browser per... by tempodox on Tuesday June 16, 2020 @11:33AM (#23540347)
Re:How the most popular Chrome extensions affect browser per... by 0-_-0 on Tuesday June 16, 2020 @11:47AM (#23540551)
That's not spam and I personally don't even have an issue with it
Re:How the most popular Chrome extensions affect browser per... by Dylan16807 on Tuesday June 16, 2020 @11:46AM (#23540528)
Noted, and bad, but I don't consider altering links to be "inserting spam".
Re:How the most popular Chrome extensions affect browser per... by VMG on Tuesday June 16, 2020 @10:06AM (#23539277)
to be fair, affiliate codes don't spike the CPU
Re:How the most popular Chrome extensions affect browser per... by TraceFree on Wednesday June 17, 2020 @03:52PM (#23555939)
When you fire up the Brave browser, it pings Google's servers and starts collecting your data. google doesnt give away multimillion dollar software applications without the ability to capture data with them.
Re:How the most popular Chrome extensions affect browser per... by pirsquare on Tuesday June 16, 2020 @08:05AM (#23538123)
Great 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.

Re:How the most popular Chrome extensions affect browser per... by Lex-2008 on Tuesday June 16, 2020 @08:37AM (#23538387)
Did 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.
Re:How the most popular Chrome extensions affect browser per... by pirsquare on Tuesday June 16, 2020 @08:48AM (#23538487)
Awesome - Didn't know about this trick. I'm reconfiguring most of the my extensions to this.

Gracias!

Re:How the most popular Chrome extensions affect browser per... by e40 on Thursday June 18, 2020 @10:38PM (#23570457)
I 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.

Re:How the most popular Chrome extensions affect browser per... by ptman on Wednesday June 17, 2020 @08:57AM (#23550805)
TIL. Would be wonderful to have this on firefox as well
Re:How the most popular Chrome extensions affect browser per... by paulhodge on Wednesday June 17, 2020 @02:26AM (#23548395)
Nothing 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.
Re:How the most popular Chrome extensions affect browser per... by the_duke on Tuesday June 16, 2020 @07:21AM (#23537829)
This 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.

Re:How the most popular Chrome extensions affect browser per... by mostlystatic on Tuesday June 16, 2020 @07:49AM (#23538025)
I 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/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-imp...

Re:How the most popular Chrome extensions affect browser per... by the_duke on Tuesday June 16, 2020 @08:15AM (#23538197)
Thanks 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.

Re:How the most popular Chrome extensions affect browser per... by darkport on Tuesday June 16, 2020 @08:15AM (#23538198)
How are you installing Firefox extensions in mobile? Is it Android only?
Re:How the most popular Chrome extensions affect browser per... by panpanna on Tuesday June 16, 2020 @08:22AM (#23538264)
Firefox for Android is (at least for my usage) pretty much desktop Firefox with a touch-friendly UI.

Firefox for iOS is not really Firefox.

Re:How the most popular Chrome extensions affect browser per... by WrtCdEvrydy on Tuesday June 16, 2020 @11:47AM (#23540547)
All webbrowsers on iOS are basically safari reskinned.
Re:How the most popular Chrome extensions affect browser per... by fluential on Wednesday June 17, 2020 @01:14AM (#23548064)
Worth a read “Explanation of the state of uBlock Origin (and other blockers) for Safari” — https://github.com/el1t/uBlock-Safari/issues/158
Re:How the most popular Chrome extensions affect browser per... by the_duke on Tuesday June 16, 2020 @08:18AM (#23538232)
Correct. Firefox Mobile supports extensions, but only on Android.

Some Chromium based Android browsers do as well.

Re:How the most popular Chrome extensions affect browser per... by PetahNZ on Tuesday June 16, 2020 @08:19AM (#23538235)
I use Kiwi Browser on Android, which is Chrome based, and supports extensions.
Re:How the most popular Chrome extensions affect browser per... by esperent on Tuesday June 16, 2020 @07:07AM (#23537742)
Not 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.

Re:How the most popular Chrome extensions affect browser per... by sp0rk on Tuesday June 16, 2020 @08:27AM (#23538297)
> 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.

Re:How the most popular Chrome extensions affect browser per... by esperent on Tuesday June 16, 2020 @10:07AM (#23539287)
Interesting.

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?

Re:How the most popular Chrome extensions affect browser per... by arprocter on Tuesday June 16, 2020 @11:25AM (#23540247)
I've seen resetting Chrome fix all sorts of weirdness:

https://support.google.com/chrome/answer/3296214?hl=en

Re:How the most popular Chrome extensions affect browser per... by eyegor on Tuesday June 16, 2020 @01:05PM (#23541439)
Resetting 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.
Re:How the most popular Chrome extensions affect browser per... by lordlimecat on Tuesday June 16, 2020 @01:38PM (#23541814)
Inspecting your PC's traffic from a sniffer on your PC to find a rootkit seems like a fool's errand.

If something has driver / kernel level privileges it can trivially hide such traffic from any sniffer you have running.

Re:How the most popular Chrome extensions affect browser per... by eyegor on Tuesday June 16, 2020 @05:49PM (#23544664)
Yes, that's why I said to inspect the router's traffic
Re:How the most popular Chrome extensions affect browser per... by glangdale on Tuesday June 16, 2020 @08:07AM (#23538147)
It'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) 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.

Re:How the most popular Chrome extensions affect browser per... by pythux on Tuesday June 16, 2020 @04:55PM (#23543990)
This 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.
Re:How the most popular Chrome extensions affect browser per... by glangdale on Tuesday June 16, 2020 @09:38PM (#23546726)
Yeah, 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).
Re:How the most popular Chrome extensions affect browser per... by pythux on Wednesday June 17, 2020 @02:04AM (#23548283)
To 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.
Re:How the most popular Chrome extensions affect browser per... by rurban on Tuesday June 16, 2020 @02:15PM (#23542268)
Hyperscan 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.
Re:How the most popular Chrome extensions affect browser per... by londons_explore on Tuesday June 16, 2020 @07:16AM (#23537788)
All 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.
Re:How the most popular Chrome extensions affect browser per... by mostlystatic on Tuesday June 16, 2020 @07:31AM (#23537892)
I 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.

Re:How the most popular Chrome extensions affect browser per... by londons_explore on Tuesday June 16, 2020 @11:58AM (#23540683)
But 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.
Re:How the most popular Chrome extensions affect browser per... by hoten on Tuesday June 16, 2020 @01:33PM (#23541767)
Lab 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.
Re:How the most popular Chrome extensions affect browser per... by erikrothoff on Tuesday June 16, 2020 @12:01PM (#23540735)
Cool 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.
Re:How the most popular Chrome extensions affect browser per... by helltone on Tuesday June 16, 2020 @12:00PM (#23540714)
If the author is here, can I suggest testing the Dark Reader extension too?
Re:How the most popular Chrome extensions affect browser per... by mostlystatic on Tuesday June 16, 2020 @04:54PM (#23543969)
Here are the test results for Dark Reader: 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-perform...

Re:How the most popular Chrome extensions affect browser per... by thomasahle on Tuesday June 16, 2020 @08:45AM (#23538461)
> 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.

Re:How the most popular Chrome extensions affect browser per... by kalleboo on Tuesday June 16, 2020 @08:52AM (#23538524)
That'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.
Re:How the most popular Chrome extensions affect browser per... by aasasd on Tuesday June 16, 2020 @04:47PM (#23543896)
Yeah, 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.
Re:How the most popular Chrome extensions affect browser per... by thomasahle on Tuesday June 16, 2020 @06:48PM (#23545260)
Exactly. If your regex engine compiles to a DFA, you can have arbitrary many or clauses with no overhead. It's pretty neat.
Re:How the most popular Chrome extensions affect browser per... by pythux on Tuesday June 16, 2020 @04:45PM (#23543869)
FYI: 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

Re:How the most popular Chrome extensions affect browser per... by traspler on Tuesday June 16, 2020 @08:48AM (#23538484)
It seems like the included pw managers like LastPass & Dashlane also impact page loading drastically. Is there even an alternative with less impact?
Re:How the most popular Chrome extensions affect browser per... by edsimpson on Tuesday June 16, 2020 @09:12AM (#23538734)
Anecdotally, I noticed a browsing speed up when I switched from LastPass to Bitwarden on older laptops.
Re:How the most popular Chrome extensions affect browser per... by njovin on Tuesday June 16, 2020 @08:38PM (#23546248)
I 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.

Re:How the most popular Chrome extensions affect browser per... by pbhjpbhj on Tuesday June 16, 2020 @10:43AM (#23539674)
Isn'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?
Re:How the most popular Chrome extensions affect browser per... by ricardojoaoreis on Tuesday June 16, 2020 @11:27AM (#23540281)
Browser 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.

Re:How the most popular Chrome extensions affect browser per... by lmkg on Tuesday June 16, 2020 @11:07AM (#23540002)
It 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?
Re:How the most popular Chrome extensions affect browser per... by aasasd on Tuesday June 16, 2020 @05:01PM (#23544061)
Alternatively, heavy code could be kept in the background script while page-injected scripts only do interaction. This would even employ the JIT properly.
Re:How the most popular Chrome extensions affect browser per... by SeanDav on Tuesday June 16, 2020 @08:15AM (#23538195)
> "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?

Re:How the most popular Chrome extensions affect browser per... by gorhill on Tuesday June 16, 2020 @10:16AM (#23539382)
Content 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.

Re:How the most popular Chrome extensions affect browser per... by pythux on Tuesday June 16, 2020 @04:52PM (#23543939)
To add to the excellent answer from Gorhill, you might find this read interesting: https://0x65.dev/blog/2019-12-20/not-all-adblockers-are-born...

It is a deep dive into how modern content blockers work and what kind of rules they have to enforce (they are usually much more complex than simple domains, though).

As a side node, I recently ran a small experiment and found out that around 90% or blocking from Easylist/EasyPrivacy/uBO lists can be done based on domain information only. But of course this leaves a lot of corner cases where sites might break or ads might still show, and ultimately more granularity is needed to address these cases.

Re:How the most popular Chrome extensions affect browser per... by esnard on Tuesday June 16, 2020 @09:03AM (#23538648)
When 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

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.

Re:How the most popular Chrome extensions affect browser per... by PetahNZ on Tuesday June 16, 2020 @08:17AM (#23538224)
Its open source right? Could you not just look it up https://github.com/duckduckgo
Re:How the most popular Chrome extensions affect browser per... by floatingatoll on Tuesday June 16, 2020 @12:14PM (#23540879)
Some filter addons perform complex logic trees based on properties other than the hostname(s) being loaded by the browser, and therefore take up more CPU and RAM for more wall-clock seconds to meet the needs of their increased complexity. They end up able to block more content than others, but that comes at a cost — which, as this page notes, can be much higher than anyone expected.
Re:How the most popular Chrome extensions affect browser per... by wereHamster on Tuesday June 16, 2020 @08:21AM (#23538254)
uBlock Origin doesn't do much worse than DDG Privacy Essentials. A few percent perhaps? I'd say on par with it…
Re:How the most popular Chrome extensions affect browser per... by salmo on Tuesday June 16, 2020 @04:25PM (#23543632)
I would be curious to see this for Firefox extensions as well.
Re:How the most popular Chrome extensions affect browser per... by k__ on Tuesday June 16, 2020 @08:29AM (#23538316)
I like Grammarly, but the extension is really crappy.
Re:How the most popular Chrome extensions affect browser per... by bvm on Tuesday June 16, 2020 @11:18AM (#23540154)
Grammarly causes a surprising amount of frontend issues.
Re:How the most popular Chrome extensions affect browser per... by ChikkaChiChi on Tuesday June 16, 2020 @04:55PM (#23543984)
Has 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.
Re:How the most popular Chrome extensions affect browser per... by iou on Tuesday June 16, 2020 @10:36AM (#23539601)
Nice article. This seems like a relevant contrast to share here https://brave.com/improved-ad-blocker-performance/
Re:How the most popular Chrome extensions affect browser per... by goalieca on Tuesday June 16, 2020 @10:06AM (#23539278)
I 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.

Re:How the most popular Chrome extensions affect browser per... by WhompingWindows on Tuesday June 16, 2020 @01:28PM (#23541703)
Can someone give me an ELI5 on Privacy Badger? My current stack is just uBlock Origin, I'm considering layering PB over the top.
Re:How the most popular Chrome extensions affect browser per... by identity0 on Tuesday June 16, 2020 @02:08PM (#23542166)
In 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.

Re:How the most popular Chrome extensions affect browser per... by PaywallBuster on Tuesday June 16, 2020 @07:35AM (#23537924)
I'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

Re:How the most popular Chrome extensions affect browser per... by smichel17 on Tuesday June 16, 2020 @07:41AM (#23537971)
For anyone glancing by: Note that this is uBlock, not uBlock origin.
Re:How the most popular Chrome extensions affect browser per... by ameyv on Tuesday June 16, 2020 @07:51AM (#23538042)
uBlock-LLC is not ublock origin.
Re:How the most popular Chrome extensions affect browser per... by sizzle on Tuesday June 16, 2020 @08:05PM (#23545946)
Am I creating a bottleneck by running Ghostery with uBlock Origin?
[dead]
Re:How the most popular Chrome extensions affect browser per... by rydre on Tuesday June 16, 2020 @08:06AM (#23538137)
Why do you want to fight over a word if you're able to understand everything and good people are trying to reduce bias in human life?

Every word that is commonly or uncommonly used has a physiological impact on perception that is not directly measurable and causes biases. In this case, whitelist = white = allow = positive. Blacklist = black = block = negative. Do you want peoples brain to subconsciously associate words like that?

Instead if we use words like 'allowlist' and 'blocklist', it reduces the association with people's skin color/ethnicity and hence the hidden biases that we do not know are present. This stuff takes generations to fix.

Re:How the most popular Chrome extensions affect browser per... by kazinator on Tuesday June 16, 2020 @10:15AM (#23539379)
> Do you want peoples brain to subconsciously associate words like that?

A well-dressed man doesn't want an ink stain on his crisp white shirt, even if he's black.

When people get cavities, those are black spots on white enamel regardless of race.

Sorry, the white-substrate-black-stain metaphor isn't going to die any time soon.

Also, the absence of light looks black. Daylight will continue to be white and nighttime black; people will continue to stumble in the dark and be afraid, regardless of their skin color. Violent crime will continue to prefer the cloak of darkness.

Re:How the most popular Chrome extensions affect browser per... by catalogia on Tuesday June 16, 2020 @10:44AM (#23539697)
It seems likely that kids and some adults will always have an irrational fear of the dark, since thousands of years ago nocturnal tigers used to eat our ancestors. The light/dark association is probably baked into our DNA due to this selective pressure; it's an unfortunate coincidence that similar words can be used to describe skin tone.
Re:How the most popular Chrome extensions affect browser per... by bzb3 on Tuesday June 16, 2020 @09:37AM (#23538974)
He didn't start the fight. They did.
Re:How the most popular Chrome extensions affect browser per... by esperent on Tuesday June 16, 2020 @07:08AM (#23537748)
I knew someone would be here clutching pearls over this. Thanks for making sure I wasn't disappointed.
Re:How the most popular Chrome extensions affect browser per... by hoseja on Tuesday June 16, 2020 @07:51AM (#23538037)
Recursive pearl-clutching. Hopefully we'll overflow the stack soon.
Re:How the most popular Chrome extensions affect browser per... by esperent on Tuesday June 16, 2020 @10:05AM (#23539257)
The only way to win is not to play.
Re:How the most popular Chrome extensions affect browser per... by kazinator on Tuesday June 16, 2020 @10:07AM (#23539282)
Oh, quit trying to whitewash the issue. :P
Re:How the most popular Chrome extensions affect browser per... by IshKebab on Tuesday June 16, 2020 @04:13PM (#23543500)
"allowwash", please.
Re:How the most popular Chrome extensions affect browser per... by kazinator on Tuesday June 16, 2020 @04:23PM (#23543610)
#FFFFFF'ing wash. :)
Re:How the most popular Chrome extensions affect browser per... by zem on Tuesday June 16, 2020 @07:18AM (#23537803)
and it's called 'url' in the code snippet but the article called it a 'website'. it's not all that hard to figure out what they are referring to.
Re:How the most popular Chrome extensions affect browser per... by Ensorceled on Tuesday June 16, 2020 @07:31AM (#23537893)
Really? This is the hill you're going to die on?
Re:How the most popular Chrome extensions affect browser per... by dsr_ on Tuesday June 16, 2020 @07:50AM (#23538034)
It must be very important to them. I wonder if they knew that before they said it in public?
Re:How the most popular Chrome extensions affect browser per... by user2233 on Tuesday June 16, 2020 @03:05PM (#23542835)
hello
Re:How the most popular Chrome extensions affect browser per... by baggy_trough on Tuesday June 16, 2020 @12:47PM (#23541237)
Don't ever install extensions. There is no limit to the trouble and pain they can cause.
Re:How the most popular Chrome extensions affect browser per... by saagarjha on Tuesday June 16, 2020 @04:37PM (#23543765)
Never browse the web. There is no limit to the trouble and pain it can cause.
Re:How the most popular Chrome extensions affect browser per... by visarga on Tuesday June 16, 2020 @06:59AM (#23537690)
Cool, 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.
Re:How the most popular Chrome extensions affect browser per... by laurent123456 on Tuesday June 16, 2020 @07:04AM (#23537721)
I 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.
Re:How the most popular Chrome extensions affect browser per... by jeffbee on Tuesday June 16, 2020 @11:25AM (#23540246)
The 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.
Re:How the most popular Chrome extensions affect browser per... by londons_explore on Tuesday June 16, 2020 @07:19AM (#23537805)
I 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....
Re:How the most popular Chrome extensions affect browser per... by smichel17 on Tuesday June 16, 2020 @07:45AM (#23537996)
That was a graph of cpu time, not network request time, and 20s of the 30s were spent parsing and running js.
Re:How the most popular Chrome extensions affect browser per... by cornedor on Tuesday June 16, 2020 @07:05AM (#23537731)
> 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.