mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-12 18:06:56 +02:00
This was causing a huge slowdown when loading some pages with weirdly huge number of style sheets. For example, amazon.com has over 200 style elements, which meant we had to resort the StyleSheetList 200 times. (And sorting itself was slow because it has to compare DOM positions.) Instead of sorting, we now look for the correct insertion point when adding new style sheets, and we start the search from the end, which is where style sheets are typically added in the vast majority of cases. This removes a 600ms time sink when loading Amazon on my machine! :^)
3.6 KiB
3.6 KiB