Reduce allocations in URLParser
[WebKit-https.git] / Source / WebCore / ChangeLog
index bdab29e..ab9aff8 100644 (file)
@@ -1,3 +1,30 @@
+2016-09-20  Alex Christensen  <achristensen@webkit.org>
+
+        Reduce allocations in URLParser
+        https://bugs.webkit.org/show_bug.cgi?id=162241
+
+        Reviewed by Chris Dumez.
+
+        Use Vectors instead of StringBuilders.  This allows us to use the inline capacity on the stack
+        for short URLs (<2KB) and also allows us to skip branches because we know whether the
+        contained type is UChar or LChar at compile time.  It also allows us to use uncheckedAppend.
+
+        Added new API tests for parts that were less tested, but there is
+        no change in behavior except for a performance improvement.
+
+        * platform/URLParser.cpp:
+        (WebCore::appendCodePoint):
+        (WebCore::encodeQuery):
+        (WebCore::URLParser::failure):
+        (WebCore::URLParser::parse):
+        (WebCore::percentDecode):
+        (WebCore::domainToASCII):
+        (WebCore::hasInvalidDomainCharacter):
+        (WebCore::URLParser::parseHost):
+        (WebCore::formURLDecode):
+        (WebCore::isC0Control): Deleted.
+        * platform/URLParser.h:
+
 2016-09-20  Nan Wang  <n_wang@apple.com>
 
         AX: voiceover does not read contents of input role="spinbutton"