Ublock Origin increases the time to load a simple demo by 4x and uses ~3x more RAM (time spent in wrappercache, proxy, xraywrapper, minorGC and related stuff)
Categories
(Core :: Performance: General, defect)
Tracking
()
People
(Reporter: mayankleoboy1, Unassigned, NeedInfo)
References
()
Details
Attachments
(1 file)
|
36.73 KB,
text/plain
|
Details |
- Go to https://forsaken-ideas.nicolas-lebrun.fr/sketch/fragmentation/
- Once it loads, reload the page using the "reload" icon inside the demo
- Now install ublock origin
- Redo step 1-2
Ublock origin uninstaled: https://share.firefox.dev/4jbzGz3 (1.3s per iteration)
Ublock origin installed: https://share.firefox.dev/41OAST9 (5.7s per iteration including cc)
This may be an obvious, known, "working as designed" bug. Feel free to INVALID
| Reporter | ||
Comment 1•8 months ago
|
||
I had an artificial testcase that creates lots of event-handlers that exhibits similar behavior.
| Reporter | ||
Comment 2•8 months ago
|
||
| Reporter | ||
Updated•8 months ago
|
Comment 3•8 months ago
•
|
||
uBO's mutation observer receives a list of 605,502 mutations, so I gather that any extension which install a mutation observer (edit: and iterate through the mutations) is going to suffer some performance issues.
For some reasons, the breakpoint I add to the mutation observer code is not triggered in neither Firefox nor Chromium, so this makes it difficult to find out if there is anything of interest in those mutations. I did add code to report the number of mutations though, and it's clearly huge.
Comment 4•8 months ago
|
||
One potential solution I could explore is that if the number of mutations is larger than a certain threshold (let's say 1,000), uBO would ignore all the mutations and simply assume the whole DOM has to be scanned starting from document.documentElement. For instance, there are only 51 elements of interest to uBO on that page, i.e. potential targets for filtering, so trying to identify these 51 targets out of a total of 600K mutation events does not make much sense.
I did try this approach and it seems to fix uBO's contribution to this issue, but I would have to further investigate if there could be bad side effects arising from the change on other sites.
Comment 5•8 months ago
|
||
The severity field is not set for this bug.
:bas.schouten, could you have a look please?
For more information, please visit BugBot documentation.
Comment 6•8 months ago
|
||
Questions:
Can the issue be reproduced with a simple extension that has a MutationObserver that reads all addedNodes / removedNodes?
(This reduction shows whether the issue is uBlock Origin-specific or potentially MutationObserver or extension related.)
If yes, can the issue be reproduced without extension, i.e. by having the same logic be run in the web page itself?
(This reduction shows the extent that the unique properties of content scripts (Xrays) contribute to this issue)
| Reporter | ||
Comment 7•8 months ago
|
||
I am not technical enough to answer any of those questions.
(ni?ing you back)
Description
•