[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

abarth at webkit.org abarth at webkit.org
Wed Dec 22 11:26:45 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5e9ada3db306442ba052c4707b006628a1794f0f
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 23 19:08:42 2010 +0000

    2010-07-23  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Reserve capacity for attributes
            https://bugs.webkit.org/show_bug.cgi?id=42877
    
            This is about a 1.7% improvement to the parsing benchmark.
    
            * html/HTMLToken.h:
            (WebCore::AtomicHTMLToken::AtomicHTMLToken):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63991 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index baea8b7..a5246c8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,18 @@
 
         Reviewed by Eric Seidel.
 
+        Reserve capacity for attributes
+        https://bugs.webkit.org/show_bug.cgi?id=42877
+
+        This is about a 1.7% improvement to the parsing benchmark.
+
+        * html/HTMLToken.h:
+        (WebCore::AtomicHTMLToken::AtomicHTMLToken):
+
+2010-07-23  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
         Inline HTMLElementStack::top
         https://bugs.webkit.org/show_bug.cgi?id=42879
 
diff --git a/WebCore/html/HTMLToken.h b/WebCore/html/HTMLToken.h
index d2987f4..407e5d7 100644
--- a/WebCore/html/HTMLToken.h
+++ b/WebCore/html/HTMLToken.h
@@ -294,7 +294,7 @@ private:
 
     // For StartTag and EndTag
     bool m_selfClosing;
-    AttributeList m_attributes; // Old tokenizer reserves 10.
+    AttributeList m_attributes;
 
     // A pointer into m_attributes used during lexing.
     Attribute* m_currentAttribute;
@@ -328,8 +328,13 @@ public:
                     String name(iter->m_name.data(), iter->m_name.size());
                     String value(iter->m_value.data(), iter->m_value.size());
                     RefPtr<Attribute> mappedAttribute = Attribute::createMapped(name, value);
-                    if (!m_attributes)
+                    if (!m_attributes) {
                         m_attributes = NamedNodeMap::create();
+                        // Reserving capacity here improves the parser
+                        // benchmark.  It might be worth experimenting with
+                        // the constant to see where the optimal point is.
+                        m_attributes->reserveInitialCapacity(10);
+                    }
                     m_attributes->insertAttribute(mappedAttribute.release(), false);
                 }
             }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list