Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU load + freezes on money.yandex.ru #3645

Closed
telekek opened this issue Mar 26, 2018 · 22 comments
Closed

High CPU load + freezes on money.yandex.ru #3645

telekek opened this issue Mar 26, 2018 · 22 comments

Comments

@telekek
Copy link

telekek commented Mar 26, 2018

Describe the issue

When I enter in my account on money.yandex.ru and start scrolling I got 100% CPU load + freezes

One or more specific URLs where the issue occurs

https://money.yandex.ru/actions
https://money.yandex.ru/catalogue

Screenshot in which the issue can be seen

image

Steps for anyone to reproduce the issue

  1. Login to your account on https://money.yandex.ru/actions
  2. Just start scrolling up and down

Your settings

  • OS/version: Windows 10 Enterprise LTSB 64-bit
  • Browser/version: Google Chrome 65.0.3325.181 64-bit
  • uBlock Origin version: 1.15.18
Your filter lists

image

With uBlock disabled all is fine. I also tested it with only one uBlock extension enabled.

After enabling "ignore general cosmetic filters" CPU load is down to 30-50% when scrolling.

Here is screenshot of blocked requests from uBo-logger:
image

@telekek
Copy link
Author

telekek commented Mar 27, 2018

I ask developer of ruadlist about it and he says that he can't fix it in filter list because it's uBlock issue, uBlock is trying to apply rules to shadow-root.:
https://forums.lanik.us/viewtopic.php?p=134351#p134351

Yeah, reproduces. When you apply in uBlock Origin for Google Chrome any rules of hiding on this page (and possibly throughout the subdomain), when scrolling is really abnormal CPU usage. Most likely, this is due to the fact that the extension is trying to apply the rules in respect of shadow-root, because neither in ublock Origin for Firefox (where shadow-root is absent), nor in Adblock Plus for Google Chrome (which simply does not climb into shadow-root) - similar behavior is not observed. I'm afraid there changes in subscriptions I will not fix anything.

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

Is there a way to reproduce without having to create an account?

@telekek
Copy link
Author

telekek commented Mar 27, 2018

Yes you can check it on https://money.yandex.ru/catalogue w/o account.

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

I can't reproduce anything like you said at that URL. I have selected most filter lists in your picture which have cosmetic filters in them. I also can't make sense of "apply the rules in respect of shadow-root", uBO makes no use of shadow root.

@telekek
Copy link
Author

telekek commented Mar 27, 2018

You must scrolling up and down fast, and at the same time see at CPU load. And even w/o scrolling fast - scrolling become "laggy".

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

I see 53 custom filters on your side. Unselect your filter list and see if this makes a difference.

@telekek
Copy link
Author

telekek commented Mar 27, 2018

I'm already do it and problem only in RUS: RU AdList, but developer of this list said that what i write above.

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

Ok I profiled using the browser tools, and I do see a performance drop with cosmetic filtering. The curious thing is that uBO is not doing anything with regard to that performance drop. The hot spot is spent in the page's own code. I suspect the added CSS rules are causing the page's own code (getBoundingClientRect ends up being called a lot by the page) to become more expensive due to the injected styles -- not because of uBO's proper. I will continue to test to see which specific injected styles are causing the issue.

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

Alright, dismiss what RU AdList dev told you: there is also a similar performance drop when using ABP with RU AdList. I will still try to figure which specific styles if any are causing this.

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

Here is what I have so far: the issue is with one of the generic cosmetic filter in RU AdList. If you disable generic cosmetic filtering OR disable RU AdList, the performance drop disappears:

@@||yandex.ru^$generichide

Again, ABP suffers the same issue, I don't know why he told you differently: the problem is that some generic styles from RU AdList injected on the page by either uBO or ABP are causing js code run by the page itself to become expensive.

@telekek
Copy link
Author

telekek commented Mar 27, 2018

Yep, with
@@||yandex.ru^$generichide
All is fine now

@telekek
Copy link
Author

telekek commented Mar 27, 2018

Tested ABP now, and I have problems too. But in "developer tools" in ABP tab nothing is blocked by RuAdList, but at the same time disabling RuAdList is solves problem (or adding @@||yandex.ru^$generichide). Idk why is that happening.

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

Those two filters in RU AdList are causing the issue:

##div[id*="ScriptRoot"] *
##div[id^="DIV_DA_"] *

Disable them with:

#@#div[id*="ScriptRoot"] *
#@#div[id^="DIV_DA_"] *

These filters are bad because they mean that all descendants of div[id^="DIV_DA_"] should be targeted. On top of this, they are completely uneeded because there is already these two filters:

##div[id*="ScriptRoot"]
##div[id^="DIV_DA_"]

So issue is with RU AdList.

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

Please report to them, if they do not want to remove them I will add the exception filters to uBO -- they are bad filters which should not be suffered by users of uBO.

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

But in "developer tools" in ABP tab nothing is blocked

Yes, the filters are still injected unconditionally because they are generic cosmetic filters. As soon as these CSS rules are present -- even if there is no match in the DOM, they cause the performance drop.

@dimisa-RUAdList
Copy link

dimisa-RUAdList commented Mar 27, 2018

These filters were added for a reason: https://hg.adblockplus.org/ruadlist/rev/388682973a18#l1.12

https://i.imgur.com/ubstvZq.jpg

Fix: https://hg.adblockplus.org/ruadlist/rev/5d21f5d101ea

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

The filter ##div[id*="ScriptRoot"] will already cause all descendants to be hidden, no need to want to hide all descendants with another filter.

@dimisa-RUAdList
Copy link

dimisa-RUAdList commented Mar 27, 2018

If this were so, I would not add it.

http://www.fast-torrent.ru/film/dvizhenie-vverh.html

@gorhill
Copy link
Owner

gorhill commented Mar 27, 2018

I cannot reproduce what you have in your screenshot after I add

#@#div[id*="ScriptRoot"] *
#@#div[id^="DIV_DA_"] *

@dimisa-RUAdList
Copy link

uBlock Origin 1.15.18
Google Chrome 65.0.3325.181
Just need to refresh the page. Maybe several times.

@telekek
Copy link
Author

telekek commented Mar 27, 2018

For me issue is fixed by:

#@#div[id*="ScriptRoot"] *
#@#div[id^="DIV_DA_"] *

Too.

UPD.:
Just updated ruadlist filter with fixes:

Fix: https://hg.adblockplus.org/ruadlist/rev/5d21f5d101ea

And now all is fine.

@dimisa-RUAdList
Copy link

Perhaps the changes have not yet entered into force. Try to update again.

@telekek telekek closed this as completed Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants