[Webkit-unassigned] [Bug 216241] Comparing styles with large but identical custom property maps is slow
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Sep 7 10:20:03 PDT 2020
https://bugs.webkit.org/show_bug.cgi?id=216241
Darin Adler <darin at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |darin at apple.com
Attachment #408181|review? |review+
Flags| |
--- Comment #3 from Darin Adler <darin at apple.com> ---
Comment on attachment 408181
--> https://bugs.webkit.org/attachment.cgi?id=408181
patch
View in context: https://bugs.webkit.org/attachment.cgi?id=408181&action=review
> Source/WebCore/ChangeLog:18
> + Going to full screen and back on youtube, this patch reduces time in the longest style update from ~460ms to ~90ms.
Amazing.
> Source/WebCore/rendering/style/RenderStyle.cpp:2337
> + if (m_rareInheritedData->customProperties.ptr() == other.m_rareInheritedData->customProperties.ptr())
> + return;
> + if (*m_rareInheritedData->customProperties == *other.m_rareInheritedData->customProperties)
> + const_cast<StyleRareInheritedData&>(m_rareInheritedData.get()).customProperties = other.m_rareInheritedData->customProperties;
Here’s another way to write it that I like slightly better:
auto& properties = const_cast<StyleRareInheritedData&>(m_rareInheritedData->customProperties);
auto& otherProperties = other.m_rareInheritedData->customProperties;
if (properties.ptr() != otherProperties.ptr() && *properties == *otherProperties)
priorities = otherProperties;
Not sure you will prefer it.
> Source/WebCore/style/StyleBuilder.cpp:196
> + Ref<CSSCustomPropertyValue> valueToApply = downcast<CSSCustomPropertyValue>(*property.cssValue[index]);
Could we use auto and makeRef here?
> Source/WebCore/style/StyleBuilder.cpp:233
> + Ref<CSSCustomPropertyValue> valueToApply = downcast<CSSCustomPropertyValue>(*property.cssValue[index]);
Could we use auto and makeRef here?
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200907/05dcbc69/attachment.htm>
More information about the webkit-unassigned
mailing list