Skip to content

Loading…

GetL10nUILanguage() causing excess cpu usage? #388

Closed
Aranjedeath opened this Issue · 6 comments

2 participants

@Aranjedeath

Hi yes my ublock is using 60% cpu (lots of tabs open, but i've never seen this behavior before). I opened the options for ublock and took a js cpu profile for ~10s, 40% of which was that function. What further help can I be to troubleshoot this? I don't know how to attach devtools to an extension.

link to cpu profile: https://mirror.explodie.org/passing/CPU-20141130T094407.cpuprofile

@Aranjedeath

I think you can actually close this, but I by complete accident found the source of the cpu usage. The list I'm using (that I made) blocks one of AOL's subdomains that they serve analytics scripts out of, but some script of theirs was trying to load a PNG from it for their comments system. As many times per second as it could (as in, generated a few thousand errors in a few seconds). uBlock did a good job and blocked those requests, but at high cpu usage cost. I'd say have a look at that half-broken-script-failing case, but I'm not sure there's a whole heck of a lot you could do. In any case, sorry for the noise!

(list, for reference: https://mirror.explodie.org/my-ublock-filters.txt )

@gorhill gorhill reopened this
@gorhill

I still want to investigate if there was anything that uBlock could have done better. I like these stress test because if I can make uBlock deal with these better, this means it will work even better everywhere else.

What is a URL where I can see the high CPU with your filters?

@Aranjedeath

Hey thanks, it's a news article http://www.aol.com/article/2014/11/29/pope-prays-in-istanbul-mosque-in-new-outreach/21000489/

I'd screenshot my lists but I can say it faster:
the three malware ones ("Malware Domains List", "Malware domains", Malware domains (long-lived)", "ublock filters", "ublock filters - privacy", and mine as a custom list.
Those are the list boxes which are checked at present.

(for maximum reproducibility. I just re-tested, and it's doing the same thing again. While typing this, I accrued 50k console errors on that page)

edit: for clarification

@gorhill

I ran a profiling session, and it seems most of the CPU cycles are spent inside the browser code, not on uBlock's code. Still, as a workaround I tried disabling inline script tags using dynamic filtering and that worked -- unsure though if the site got broken by this.

Just for the record, one of these filters triggered the issue:

|http://b.aol.com
|http://o.aolcdn.com/
|https://s.aolcdn.com/ads
|http://s.aolcdn.com/os/aol/
|http://o.sa.aol.com

Pasted here so I don't need to paste the whole set next time I want to repro.

@Aranjedeath

Excellent. Let me know if I can help further.
The articles still seem to be readable with that change, so excellent. I don't use AOL news much so the cpu usage is of no real consequence to me, but I'm trying to make my list (and ublock, when it falls on you) break as few things as possible :D

The specific line blocking the image (and causing the cpu usage) is
|http://o.aolcdn.com/

@gorhill

Can't repro this specific case.

@gorhill gorhill closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.