Give RuleFeatures::classesMatchingAncestors some inline capacity.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Jun 2016 15:20:06 +0000 (15:20 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Jun 2016 15:20:06 +0000 (15:20 +0000)
<https://webkit.org/b/158356>

Reviewed by Darin Adler.

Avoid 362'000 heap allocations on PLUM (1.3% of all transient fastMallocs) by giving
RuleFeatures::classesMatchingAncestors some inline capacity (32).
This class is only ever allocated on the stack anyway.

* css/RuleFeature.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201697 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/RuleFeature.h

index 4066d14..d88258d 100644 (file)
@@ -1,3 +1,16 @@
+2016-06-05  Andreas Kling  <akling@apple.com>
+
+        Give RuleFeatures::classesMatchingAncestors some inline capacity.
+        <https://webkit.org/b/158356>
+
+        Reviewed by Darin Adler.
+
+        Avoid 362'000 heap allocations on PLUM (1.3% of all transient fastMallocs) by giving
+        RuleFeatures::classesMatchingAncestors some inline capacity (32).
+        This class is only ever allocated on the stack anyway.
+
+        * css/RuleFeature.h:
+
 2016-06-05  Brady Eidson  <beidson@apple.com>
 
         Unreviewed, rolling out r201693.
index 11bd814..906ef53 100644 (file)
@@ -74,7 +74,7 @@ struct RuleFeatureSet {
 private:
     struct SelectorFeatures {
         bool hasSiblingSelector { false };
-        Vector<AtomicStringImpl*> classesMatchingAncestors;
+        Vector<AtomicStringImpl*, 32> classesMatchingAncestors;
         Vector<const CSSSelector*> attributeSelectorsMatchingAncestors;
     };
     void recursivelyCollectFeaturesFromSelector(SelectorFeatures&, const CSSSelector&, bool matchesAncestor = false);