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 processor usage on heise.de #1392

Closed
yokoffing opened this issue Nov 21, 2023 · 5 comments
Closed

High processor usage on heise.de #1392

yokoffing opened this issue Nov 21, 2023 · 5 comments

Comments

@yokoffing
Copy link

Ghostery causes Firefox to have a high CPU utilization simply when https://www.heise.de/ is displayed. Also a performance profiling yields Javascript functions being the hottest methods.

URL: https://www.heise.de/
Ghostery version: 8.11.1
Browser name: Firefox
Browser version: 119.0.1
Language: en
OS: MS Windows 10

Similar to: #757

task-manager

call-stack

@philipp-classen
Copy link
Member

philipp-classen commented Apr 11, 2024

The hot path in the screenshot is the same function as here: #757 (comment)

Note to investigate later: it could be that there are frequent DOM mutations near the top of the document. Then iterating over all matches of this expression can become costly:

querySelectorAll(
        '[id]:not(html):not(body),[class]:not(html):not(body),[href]:not(html):not(body)'

If that is the case, it is most likely not isolated to Firefox, but affects Chrome as well. Only that the overhead in Chrome is not as big (either Chrome does some throttling, or the DOM API & JavaScript engine is faster for this operation).

philipp-classen added a commit to ghostery/adblocker that referenced this issue Apr 16, 2024
if there are bursts of DOM modifcation events, even though there are
no changes.

refs ghostery/ghostery-extension#757
refs ghostery/ghostery-extension#1392
philipp-classen added a commit to ghostery/adblocker that referenced this issue Apr 16, 2024
if there are bursts of DOM modification events, even though there are
no changes.

refs ghostery/ghostery-extension#757
refs ghostery/ghostery-extension#1392
philipp-classen added a commit to ghostery/adblocker that referenced this issue Apr 16, 2024
if there are bursts of DOM modification events, even though there are
no changes.

refs ghostery/ghostery-extension#757
refs ghostery/ghostery-extension#1392
philipp-classen added a commit to ghostery/adblocker that referenced this issue Apr 16, 2024
if there are bursts of DOM modification events, even though there are
no changes.

refs ghostery/ghostery-extension#757
refs ghostery/ghostery-extension#1392
philipp-classen added a commit to ghostery/adblocker that referenced this issue Apr 16, 2024
if there are bursts of DOM modification events, even though there are
no changes.

refs ghostery/ghostery-extension#757
refs ghostery/ghostery-extension#1392
@Nahor
Copy link

Nahor commented May 26, 2024

I'm not able to reproduce the issue anymore (Firefox 126.0, Ghostery 8.12.10)

@philipp-classen
Copy link
Member

I'm not able to reproduce the issue anymore (Firefox 126.0, Ghostery 8.12.10)

Thanks for checking! I will close it.

(Background: The performance bug used to be reproducible with Ghostery when it was installed next to uBlock Origin. But uBlock Origin optimized the scriplet that could cause DOM modification events being spammed: gorhill/uBlock@91dfcbe#diff-30b28769623e5478a0f68519eda037164484cfb444cb5a8e48518fa7bb32e658R2267)

@Nahor
Copy link

Nahor commented May 27, 2024

I'm not sure that this bug was caused by the interaction with uBO. When I tried with uBO disabled, I was still seeing the issue. A further difference with the uBO interaction, is that the CPU was not 100% like on the Reddit website, and as can be seen the screenshot in the top post, where there are gaps in the CPU usage.

I suspect the fix for this bug is in the website itself (or in Firefox)

@philipp-classen
Copy link
Member

I'm not sure that this bug was caused by the interaction with uBO. When I tried with uBO disabled, I was still seeing the issue. A further difference with the uBO interaction, is that the CPU was not 100% like on the Reddit website, and as can be seen the screenshot in the top post, where there are gaps in the CPU usage.

I suspect the fix for this bug is in the website itself (or in Firefox)

Good point, I forget that aspect. I remember that I was not able reproduce myself (without uBlock Origin); but there could have been subtle details like screen resolution, etc, which may have had an effect on DOM modifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants