mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-13 02:16:52 +02:00
The `shorthands_for_longhand`, `longhands_for_shorthand`, and `expanded_longhands_for_shorthand` methods can be pretty hot in profiles where we serialize a lot of CSS properties. By returning a const reference to a static vector instead of allocating and returning a new vector every time we can avoid a decent amount of work. Overall runtime for the particularly serialization heavy wpt.live/css/cssom/cssom-getPropertyValue-common-checks.html decreased by ~20% comparing before and after this change.
64 KiB
64 KiB