mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-09 16:42:19 +02:00
Add a per-Document cache that maps selector strings to their parsed SelectorList results. This avoids re-tokenizing and re-parsing the same selector strings on every call, which is a huge win for pages that repeatedly call querySelectorAll with the same selectors. On microsoft.com, where they spam querySelectorAll with the same two selectors, profiling showed 62% of main thread time was spent re-parsing selectors. This cache eliminates that entirely for repeated queries.
14 KiB
14 KiB