| Summary: | Comparing styles with large but identical custom property maps is slow | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Antti Koivisto <koivisto> | ||||||
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | changseok, darin, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, kondapallykalyan, macpherson, menard, pdr, simon.fraser | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Antti Koivisto
2020-09-07 04:27:54 PDT
Created attachment 408181 [details]
patch
Comment on attachment 408181 [details] 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? Created attachment 408216 [details]
patch
Committed r266717: <https://trac.webkit.org/changeset/266717> All reviewed patches have been landed. Closing bug and clearing flags on attachment 408216 [details]. |