Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More juicy speed-ups for wpt.fyi #3356

Merged

Conversation

awesomekling
Copy link
Member

@awesomekling awesomekling commented Jan 24, 2025

Let's do a lot less work in StyleComputer on the WPT dashboard at https://wpt.fyi/

See individual commits.

Bonus: Remove some unnecessary copying in the AK::JsonValue constructors that was costing us a ton of time.

This allows us to filter by layer *once* instead of doing it for every
rule that runs.

Knocks ~2 seconds of loading time off of https://wpt.fyi/
Instead, change the APIs from "has :foo" to "may have :foo" and return
true if we don't have a valid rule cache at the moment.

This allows us to defer the rebuilding of the rule cache until a later
time, for the cost of a wider invalidation at the moment.

Do note that if our rule cache is invalid, the whole document has
invalid style anyway! So this is actually always less work. :^)

Knocks ~1 second of loading time off of https://wpt.fyi/
Instead of creating and passing around Vector<MatchingRule> inside
StyleComputer (internally, not exposed in API), we now use vectors
of pointers/references instead.

Note that we use pointers in case we want to quick_sort() the vectors.

Knocks 4 seconds of loading time off of https://wpt.fyi/
@awesomekling awesomekling merged commit cfe3dbe into LadybirdBrowser:master Jan 24, 2025
7 checks passed
@awesomekling awesomekling deleted the more_wpt_fyi_style_speedups branch January 24, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant