Changeset 128804 in webkit
- Timestamp:
- Sep 17, 2012 2:11:04 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128800 r128804 1 2012-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 1 21 2012-09-17 Rob Buis <rbuis@rim.com> 2 22 -
trunk/Source/WebCore/css/CSSParser.cpp
r128663 r128804 10419 10419 const CSSPropertyID propertyID = hashTableEntry ? static_cast<CSSPropertyID>(hashTableEntry->id) : CSSPropertyInvalid; 10420 10420 10421 // 600 is comfortably larger than numCSSProperties to allow for growth10422 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 } 10427 10427 10428 10428 return propertyID;
Note: See TracChangeset
for help on using the changeset viewer.