mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
If we determine that a selector is simple enough, we now run it using a special matching loop that traverses up the DOM ancestor chain without recursion. The criteria for this fast path are: - All combinators involved must be either descendant or child. - Only tag name, class, ID and attribute selectors allowed. It's definitely possible to increase the coverage of this fast path, but this first version already provides a substantial reduction in time spent evaluating selectors. 48% of the selectors evaluated when loading our GitHub repo are now using this fast path. 18% speed-up on the "Descendant and child combinators" subtest of StyleBench. :^)
7.4 KiB
7.4 KiB