Changeset 179917 in webkit
- Timestamp:
- Feb 10, 2015, 10:02:40 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
css/StyleProperties.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r179916 r179917 1 2015-02-10 Chris Dumez <cdumez@apple.com> 2 3 Optimize MutableStyleProperties::removePropertiesInSet() 4 https://bugs.webkit.org/show_bug.cgi?id=141460 5 6 Reviewed by Andreas Kling. 7 8 Optimize MutableStyleProperties::removePropertiesInSet() by doing an 9 in-place removal of the vector properties, using the new and efficient 10 Vector::removalAllMatching(). 11 12 I see a ~11% speed-up on CSS/CSSPropertySetterGetter.html performance 13 test. 14 15 This change was inspired by the following Blink revision: 16 https://src.chromium.org/viewvc/blink?view=rev&revision=189387 17 18 Test: PerformanceTests/CSS/CSSPropertySetterGetter.html 19 20 * css/StyleProperties.cpp: 21 (WebCore::MutableStyleProperties::removePropertiesInSet): 22 1 23 2015-02-10 Alex Christensen <achristensen@webkit.org> 2 24 -
trunk/Source/WebCore/css/StyleProperties.cpp
r178586 r179917 1134 1134 toRemove.add(set[i]); 1135 1135 1136 Vector<CSSProperty> newProperties; 1137 newProperties.reserveInitialCapacity(m_propertyVector.size()); 1138 1139 unsigned size = m_propertyVector.size(); 1140 for (unsigned n = 0; n < size; ++n) { 1141 const CSSProperty& property = m_propertyVector.at(n); 1136 return m_propertyVector.removeAllMatching([&toRemove] (const CSSProperty& property) { 1142 1137 // Not quite sure if the isImportant test is needed but it matches the existing behavior. 1143 if (!property.isImportant()) { 1144 if (toRemove.contains(property.id())) 1145 continue; 1146 } 1147 newProperties.append(property); 1148 } 1149 1150 bool changed = newProperties.size() != m_propertyVector.size(); 1151 m_propertyVector = newProperties; 1152 return changed; 1138 return !property.isImportant() && toRemove.contains(property.id()); 1139 }) > 0; 1153 1140 } 1154 1141
Note:
See TracChangeset
for help on using the changeset viewer.