Title: [106925] trunk/Source/WebCore
Revision
106925
Author
kl...@webkit.org
Date
2012-02-07 04:29:28 -0800 (Tue, 07 Feb 2012)

Log Message

REGRESSION(r106819): ~28% or so performance regression on the ManInBlue HTML benchmark
<http://webkit.org/b/77952>

Reviewed by Andreas Kling.
Patch by Ryosuke Niwa.

The performance regression was caused by using ensureAttributeData() which forces the
regeneration of invalidated attributes ("style" and SVG animatable attributes.)
Added an ensureAttributeDataWithoutUpdate() helper that only ensures the presence
of ElementAttributeData, not the validity of its contents. Use that when grabbing
at an element's inline and attribute styles.

* dom/Element.h:
(Element):
(WebCore::Element::ensureAttributeDataWithoutUpdate):
* dom/StyledElement.h:
(WebCore::StyledElement::ensureInlineStyleDecl):
(WebCore::StyledElement::ensureAttributeStyle):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106924 => 106925)


--- trunk/Source/WebCore/ChangeLog	2012-02-07 12:23:12 UTC (rev 106924)
+++ trunk/Source/WebCore/ChangeLog	2012-02-07 12:29:28 UTC (rev 106925)
@@ -1,3 +1,24 @@
+2012-02-07  Andreas Kling  <awesomekl...@apple.com>
+
+        REGRESSION(r106819): ~28% or so performance regression on the ManInBlue HTML benchmark
+        <http://webkit.org/b/77952>
+
+        Reviewed by Andreas Kling.
+        Patch by Ryosuke Niwa.
+
+        The performance regression was caused by using ensureAttributeData() which forces the
+        regeneration of invalidated attributes ("style" and SVG animatable attributes.)
+        Added an ensureAttributeDataWithoutUpdate() helper that only ensures the presence
+        of ElementAttributeData, not the validity of its contents. Use that when grabbing
+        at an element's inline and attribute styles.
+
+        * dom/Element.h:
+        (Element):
+        (WebCore::Element::ensureAttributeDataWithoutUpdate):
+        * dom/StyledElement.h:
+        (WebCore::StyledElement::ensureInlineStyleDecl):
+        (WebCore::StyledElement::ensureAttributeStyle):
+
 2012-02-07  Michael BrĂ¼ning  <michael.brun...@nokia.com>
 
         [Qt][WK2] Compute and set cache capacities using the current CacheModel

Modified: trunk/Source/WebCore/dom/Element.h (106924 => 106925)


--- trunk/Source/WebCore/dom/Element.h	2012-02-07 12:23:12 UTC (rev 106924)
+++ trunk/Source/WebCore/dom/Element.h	2012-02-07 12:29:28 UTC (rev 106925)
@@ -242,6 +242,9 @@
     ElementAttributeData* attributeData() const { return m_attributeMap ? m_attributeMap->attributeData() : 0; }
     ElementAttributeData* ensureAttributeData() const { return ensureUpdatedAttributes()->attributeData(); }
 
+    // FIXME: This method should be removed once AttributeData is moved to Element.
+    ElementAttributeData* ensureAttributeDataWithoutUpdate() const { return ensureAttributeMap()->attributeData(); }
+
     void setAttributesFromElement(const Element&);
 
     virtual void copyNonAttributeProperties(const Element* source);

Modified: trunk/Source/WebCore/dom/StyledElement.h (106924 => 106925)


--- trunk/Source/WebCore/dom/StyledElement.h	2012-02-07 12:23:12 UTC (rev 106924)
+++ trunk/Source/WebCore/dom/StyledElement.h	2012-02-07 12:29:28 UTC (rev 106925)
@@ -48,11 +48,11 @@
     void invalidateStyleAttribute();
 
     StylePropertySet* inlineStyleDecl() const { return attributeData() ? attributeData()->inlineStyleDecl() : 0; }
-    StylePropertySet* ensureInlineStyleDecl() { return ensureAttributeData()->ensureInlineStyleDecl(this); }
+    StylePropertySet* ensureInlineStyleDecl() { return ensureAttributeDataWithoutUpdate()->ensureInlineStyleDecl(this); }
     virtual CSSStyleDeclaration* style() OVERRIDE { return ensureInlineStyleDecl()->ensureCSSStyleDeclaration(); }
 
     StylePropertySet* attributeStyle() const { return attributeData() ? attributeData()->attributeStyle() : 0; }
-    StylePropertySet* ensureAttributeStyle() { return ensureAttributeData()->ensureAttributeStyle(this); }
+    StylePropertySet* ensureAttributeStyle() { return ensureAttributeDataWithoutUpdate()->ensureAttributeStyle(this); }
 
     const SpaceSplitString& classNames() const;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to