Title: [187594] trunk/Source/WebKit2
Revision
187594
Author
cdu...@apple.com
Date
2015-07-30 11:36:59 -0700 (Thu, 30 Jul 2015)

Log Message

Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
https://bugs.webkit.org/show_bug.cgi?id=147446

Reviewed by Simon Fraser.

Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
by leveraging the fact that we know in advance how many layer IDs are going to be added. We
now set the Vector size from the start, instead of clearing it and then growing the vector
capacity when appending the layer IDs one by one.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (187593 => 187594)


--- trunk/Source/WebKit2/ChangeLog	2015-07-30 18:32:45 UTC (rev 187593)
+++ trunk/Source/WebKit2/ChangeLog	2015-07-30 18:36:59 UTC (rev 187594)
@@ -1,5 +1,20 @@
 2015-07-30  Chris Dumez  <cdu...@apple.com>
 
+        Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
+        https://bugs.webkit.org/show_bug.cgi?id=147446
+
+        Reviewed by Simon Fraser.
+
+        Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
+        by leveraging the fact that we know in advance how many layer IDs are going to be added. We
+        now set the Vector size from the start, instead of clearing it and then growing the vector
+        capacity when appending the layer IDs one by one.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
+
+2015-07-30  Chris Dumez  <cdu...@apple.com>
+
         Mark more classes as fast allocated
         https://bugs.webkit.org/show_bug.cgi?id=147440
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (187593 => 187594)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp	2015-07-30 18:32:45 UTC (rev 187593)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp	2015-07-30 18:36:59 UTC (rev 187594)
@@ -158,9 +158,9 @@
 
     if (m_properties.changedProperties != RemoteLayerTreeTransaction::NoChange) {
         if (m_properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
-            m_properties.children.clear();
-            for (const auto& layer : m_children)
-                m_properties.children.append(layer->layerID());
+            m_properties.children.resize(m_children.size());
+            for (size_t i = 0; i < m_children.size(); ++i)
+                m_properties.children[i] = m_children[i]->layerID();
         }
 
         if (isPlatformCALayerRemoteCustom()) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to