3 ms·
What other options do you see? Searching and manipulating DOM in JavaScript wouldn't be faster than a single CSS stylesheet. Remember that there are >20K rules
by lauriswtf 12y ago
What other options do you see? Searching and manipulating DOM in JavaScript wouldn't be faster than a single CSS stylesheet. Remember that there are >20K rules in play.
- drdaeman 12y ago20K rules probably isn't that big, when you compile that to an automata. Most nodes are probably behind the edges that never traversed. If there would be an option for a extension to hook into DOM element creation (i.e. when browser parses HTML and builds a tree, it'd call some user-defined predicate function) - that would possibly solve the issue. I believe CSS is slow because of cascading nature - it requires re-compiling it from the very plaintext source on every page view, to combine ad-blocking rules with others - this certainly could be optimized (if browser side would provide tools for that). No idea about horrendous memory usage, though.