Optimize Style::determineChange()
Created attachment 390194 [details] Patch
Comment on attachment 390194 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=390194&action=review > Source/WebCore/rendering/style/RenderStyle.cpp:451 > +bool RenderStyle::alignItemsEqual(const RenderStyle& other) const > +{ > + return m_rareNonInheritedData.ptr() == other.m_rareNonInheritedData.ptr() > + || m_rareNonInheritedData->alignItems == other.m_rareNonInheritedData->alignItems; > +} > + > +bool RenderStyle::justifyItemsEqual(const RenderStyle& other) const > +{ > + return m_rareNonInheritedData.ptr() == other.m_rareNonInheritedData.ptr() > + || m_rareNonInheritedData->justifyItems == other.m_rareNonInheritedData->justifyItems; > +} Combining these ("alignAndJustifyItemsEqual") would eliminate one m_rareNonInheritedData comparison.
(In reply to Antti Koivisto from comment #2) > Comment on attachment 390194 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=390194&action=review > > > Source/WebCore/rendering/style/RenderStyle.cpp:451 > > +bool RenderStyle::alignItemsEqual(const RenderStyle& other) const > > +{ > > + return m_rareNonInheritedData.ptr() == other.m_rareNonInheritedData.ptr() > > + || m_rareNonInheritedData->alignItems == other.m_rareNonInheritedData->alignItems; > > +} > > + > > +bool RenderStyle::justifyItemsEqual(const RenderStyle& other) const > > +{ > > + return m_rareNonInheritedData.ptr() == other.m_rareNonInheritedData.ptr() > > + || m_rareNonInheritedData->justifyItems == other.m_rareNonInheritedData->justifyItems; > > +} > > Combining these ("alignAndJustifyItemsEqual") would eliminate one > m_rareNonInheritedData comparison. I thought about that. Wasn't sure what to name the function.
Created attachment 390204 [details] Patch
Comment on attachment 390204 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=390204&action=review > Source/WebCore/style/StyleChange.cpp:56 > + if (!s1.childAffectingFlexPropertiesEqual(s2)) > + return Inherit; Seems like this also affects grid. Could also be something more generic like descendantStyleAffectingNonInheritedPropertiesEqual
https://trac.webkit.org/changeset/256102/webkit
<rdar://problem/59300384>