Micro-optimize RenderBoxModelObject::computedCSSPadding().
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jan 2014 02:31:25 +0000 (02:31 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jan 2014 02:31:25 +0000 (02:31 +0000)
<https://webkit.org/b/127208>

Make computedCSSPadding() take the Length as a const reference
to avoid creating a temporary copy. This was showing up (0.2%)
on DoYouEvenBench.

Reviewed by Anders Carlsson.

* rendering/RenderBoxModelObject.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computedCSSPadding):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162238 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h

index 437a0804647295d0054e539a1151d94771c30ed0..154696c9f138a8fff0f1a9c83edd812f7f5fa0a3 100644 (file)
@@ -1,3 +1,18 @@
+2014-01-17  Andreas Kling  <akling@apple.com>
+
+        Micro-optimize RenderBoxModelObject::computedCSSPadding().
+        <https://webkit.org/b/127208>
+
+        Make computedCSSPadding() take the Length as a const reference
+        to avoid creating a temporary copy. This was showing up (0.2%)
+        on DoYouEvenBench.
+
+        Reviewed by Anders Carlsson.
+
+        * rendering/RenderBoxModelObject.h:
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::computedCSSPadding):
+
 2014-01-17  Anders Carlsson  <andersca@apple.com>
 
         Add a callOnMainThreadAndWait variant in SocketStreamHandle
index e9740564f97c4e3577ef4793ad6a3625b5221c14..6678815aeb5ca822bb43f7ea157337314b951b61 100644 (file)
@@ -484,7 +484,7 @@ int RenderBoxModelObject::pixelSnappedOffsetHeight() const
     return snapSizeToPixel(offsetHeight(), offsetTop());
 }
 
-LayoutUnit RenderBoxModelObject::computedCSSPadding(Length padding) const
+LayoutUnit RenderBoxModelObject::computedCSSPadding(const Length& padding) const
 {
     LayoutUnit w = 0;
     if (padding.isPercent())
index 18f33b408070531ee802c636f82e878a61df327e..6ed2269913660f6fe8191eb3f367c8016c2d7b07 100644 (file)
@@ -314,7 +314,7 @@ public:
     void moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert = false);
 
 private:
-    LayoutUnit computedCSSPadding(Length) const;
+    LayoutUnit computedCSSPadding(const Length&) const;
     
     virtual LayoutRect frameRectForStickyPositioning() const = 0;