Closed Bug 1640545 Opened 5 years ago Closed 5 years ago

make attribute substring selectors a little faster

Categories

(Core :: CSS Parsing and Computation, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: heycam, Assigned: heycam)

References

Details

Attachments

(1 file, 1 obsolete file)

I use uBlock Origin. That inserts a style sheet with around 700 [href^=...] selectors and 100 [href*=...]. I accidentally took a Gecko profile with uBlock Origin enabled, and I noticed that on pages with many links, this can add a substantial amount of processing time. For example, on the HTML single page spec on my fast machine, we spend a total of 1.1 seconds under Gecko_AttrHasPrefix during page load. It looks like a lot of that is refcount traffic on the string buffer that the nsAttrValue holds. Adding functions to nsAttrValue to do the substring matches so that we don't need to take a new reference to the string buffer saves 520 ms.

Depends on: 1640540
Attachment #9151378 - Attachment description: Bug 1640545 - Avoid refcount traffic on string buffers when evaluating attribute substring selectors. → Bug 1640545 - Make attribute substring selectors a little faster.
Summary: avoid string buffer refcount traffic when matching attribute substring selectors → make attribute substring selectors a little faster
Pushed by cmccormack@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1a207307e72c Make attribute substring selectors a little faster. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78

Comment on attachment 9151942 [details]
Bug 1640545 - Add perf-reftest-singleton for bug 1640545 changes.

Revision D76966 was moved to bug 1641108. Setting attachment 9151942 [details] to obsolete.

Attachment #9151942 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: