Title: [136972] trunk/Source/WebCore
Revision
136972
Author
[email protected]
Date
2012-12-07 12:41:30 -0800 (Fri, 07 Dec 2012)

Log Message

Improve our decoded data size estimation for style sheets.
<http://webkit.org/b/104388>

Reviewed by Antti Koivisto.

Tweak how we estimate the total decoded size of a given style sheet. (We were guessing at about 30% of actual size.)
This is just used as a hint to the WebCore cache.

* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::averageSizeInBytes):
* css/StyleRule.cpp:
(WebCore::StyleRule::averageSizeInBytes):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136971 => 136972)


--- trunk/Source/WebCore/ChangeLog	2012-12-07 20:39:56 UTC (rev 136971)
+++ trunk/Source/WebCore/ChangeLog	2012-12-07 20:41:30 UTC (rev 136972)
@@ -1,3 +1,18 @@
+2012-12-07  Andreas Kling  <[email protected]>
+
+        Improve our decoded data size estimation for style sheets.
+        <http://webkit.org/b/104388>
+
+        Reviewed by Antti Koivisto.
+
+        Tweak how we estimate the total decoded size of a given style sheet. (We were guessing at about 30% of actual size.)
+        This is just used as a hint to the WebCore cache.
+
+        * css/StylePropertySet.cpp:
+        (WebCore::StylePropertySet::averageSizeInBytes):
+        * css/StyleRule.cpp:
+        (WebCore::StyleRule::averageSizeInBytes):
+
 2012-12-07  Robert Hogan  <[email protected]>
 
         REGRESSION(r127163): Content is offset to the right at rea.ru

Modified: trunk/Source/WebCore/css/StylePropertySet.cpp (136971 => 136972)


--- trunk/Source/WebCore/css/StylePropertySet.cpp	2012-12-07 20:39:56 UTC (rev 136971)
+++ trunk/Source/WebCore/css/StylePropertySet.cpp	2012-12-07 20:41:30 UTC (rev 136972)
@@ -1209,7 +1209,7 @@
 unsigned StylePropertySet::averageSizeInBytes()
 {
     // Please update this if the storage scheme changes so that this longer reflects the actual size.
-    return sizeForImmutableStylePropertySetWithPropertyCount(2);
+    return sizeForImmutableStylePropertySetWithPropertyCount(4);
 }
 
 void StylePropertySet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const

Modified: trunk/Source/WebCore/css/StyleRule.cpp (136971 => 136972)


--- trunk/Source/WebCore/css/StyleRule.cpp	2012-12-07 20:39:56 UTC (rev 136971)
+++ trunk/Source/WebCore/css/StyleRule.cpp	2012-12-07 20:41:30 UTC (rev 136972)
@@ -240,7 +240,7 @@
 
 unsigned StyleRule::averageSizeInBytes()
 {
-    return sizeof(StyleRule) + StylePropertySet::averageSizeInBytes();
+    return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSizeInBytes();
 }
 
 void StyleRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to