Skip to content
Permalink
Browse files
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):


Canonical link: https://commits.webkit.org/122546@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Andreas Kling committed Dec 7, 2012
1 parent 0864492 commit 51d7d342ed0b91d3af05912b89cc63ba1df5525b
Showing with 17 additions and 2 deletions.
  1. +15 −0 Source/WebCore/ChangeLog
  2. +1 −1 Source/WebCore/css/StylePropertySet.cpp
  3. +1 −1 Source/WebCore/css/StyleRule.cpp
@@ -1,3 +1,18 @@
2012-12-07 Andreas Kling <akling@apple.com>

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 <robert@webkit.org>

REGRESSION(r127163): Content is offset to the right at rea.ru
@@ -1209,7 +1209,7 @@ CSSStyleDeclaration* StylePropertySet::ensureInlineCSSStyleDeclaration(const Sty
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
@@ -240,7 +240,7 @@ PassRefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet

unsigned StyleRule::averageSizeInBytes()
{
return sizeof(StyleRule) + StylePropertySet::averageSizeInBytes();
return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSizeInBytes();
}

void StyleRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const

0 comments on commit 51d7d34

Please sign in to comment.