Changeset 128804 in webkit


Ignore:
Timestamp:
Sep 17, 2012 2:11:04 PM (12 years ago)
Author:
tony@chromium.org
Message:

Make CSS.PrefixUsage histogram smaller to save memory
https://bugs.webkit.org/show_bug.cgi?id=96941

Reviewed by Ojan Vafai.

Each bucket costs about 12 bytes. This reduces the size of the histogram
from 600 to 384, which will save about 2.5k per renderer and browser
process.

In the long run, we could probably generate a table in makeprop.pl that
only has the webkit prefix values to save even more memory (there are
194 properties that start with -webkit).

No new tests, just refactoring.

  • css/CSSParser.cpp:

(WebCore::cssPropertyID):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128800 r128804  
     12012-09-17  Tony Chang  <tony@chromium.org>
     2
     3        Make CSS.PrefixUsage histogram smaller to save memory
     4        https://bugs.webkit.org/show_bug.cgi?id=96941
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Each bucket costs about 12 bytes. This reduces the size of the histogram
     9        from 600 to 384, which will save about 2.5k per renderer and browser
     10        process.
     11
     12        In the long run, we could probably generate a table in makeprop.pl that
     13        only has the webkit prefix values to save even more memory (there are
     14        194 properties that start with -webkit).
     15
     16        No new tests, just refactoring.
     17
     18        * css/CSSParser.cpp:
     19        (WebCore::cssPropertyID):
     20
    1212012-09-17  Rob Buis  <rbuis@rim.com>
    222
  • trunk/Source/WebCore/css/CSSParser.cpp

    r128663 r128804  
    1041910419    const CSSPropertyID propertyID = hashTableEntry ? static_cast<CSSPropertyID>(hashTableEntry->id) : CSSPropertyInvalid;
    1042010420
    10421     // 600 is comfortably larger than numCSSProperties to allow for growth
    10422     static const int CSSPropertyHistogramSize = 600;
    10423     COMPILE_ASSERT(CSSPropertyHistogramSize > numCSSProperties, number_of_css_properties_exceed_CSSPropertyHistogramSize);
    10424 
    10425     if (hasPrefix(buffer, length, "-webkit-") && propertyID != CSSPropertyInvalid)
    10426         HistogramSupport::histogramEnumeration("CSS.PrefixUsage", max(1, propertyID - firstCSSProperty), CSSPropertyHistogramSize);
     10421    static const int cssPropertyHistogramSize = numCSSProperties;
     10422    if (hasPrefix(buffer, length, "-webkit-") && propertyID != CSSPropertyInvalid) {
     10423        int histogramValue = propertyID - firstCSSProperty;
     10424        ASSERT(0 <= histogramValue && histogramValue < cssPropertyHistogramSize);
     10425        HistogramSupport::histogramEnumeration("CSS.PrefixUsage", histogramValue, cssPropertyHistogramSize);
     10426    }
    1042710427
    1042810428    return propertyID;
Note: See TracChangeset for help on using the changeset viewer.