slowdown on a website due to slow Element.classList.values() (which slows down uBlock)
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox101 | --- | fixed |
People
(Reporter: drsdk102, Assigned: emilio)
References
()
Details
Attachments
(3 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Android 11; Mobile; rv:98.0) Gecko/98.0 Firefox/98.0
Steps to reproduce:
- Install ublock origin stable 1.42, update its filters
- visit website https://moviewatchonline.com.pk/
- after loading website completely, page becomes unresponsive followed by firefox dialog ublock origin is slowing down the firefox,to speedup your browser, stop that extension
- addon developer is contacted here https://github.com/uBlockOrigin/uBlock-issues/discussions/2076
Actual results:
firefox becomes unresponsive
Expected results:
firefox should run normally
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
DOMTokenList is DOM code. I can take a look anyways. It seems from the profile that nsDOMTokenList::RemoveDuplicates
takes most of the time, because it can be quadratic when there are duplicate tokens.
Assignee | ||
Comment 2•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
This prevents DOMTokenList from being quadratic / needing to iterate
over all values on the indexed getter, which can get slow with long
class lists.
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Remember whether we have already de-duplicated them once and avoid doing
that again.
This is an alternative approach that doesn't add overhead to attribute
setting in the general case.
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/49b1e879a2c9 Deduplicate TokenList values faster. r=smaug
Updated•2 years ago
|
Comment 6•2 years ago
|
||
bugherder |
Comment 7•2 years ago
|
||
Sorry to post on a closed bug, but I've got a loose end:
It looks to me that the patch here makes it so code can't use nsAttrValue
without having a previous #include "nsAtom.h"
. This is because the new struct AttrAtomArray
has inline code which requires the full nsAtom
definition rather than just the forward declaration.
It caused some (easily fixed) build bustage over in Thunderbird (Bug 1763034). I've landed a fix there, but it seems like it might be more correct to replace the nsAtom
forward declaration in nsAttrValue.h
with #include "nsAtom.h"
?
Anyway, I'll post my proposed patch and you can decide :-)
Comment 8•2 years ago
|
||
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Pushed by geoff@darktrojan.net: https://hg.mozilla.org/integration/autoland/rev/675457b38270 Allow nsAttrValue use without requiring a prior #include "nsAtom.h". r=emilio
Comment 11•2 years ago
|
||
bugherder |
Description
•