Changeset 206924 in webkit


Ignore:
Timestamp:
Oct 7, 2016, 12:03:13 PM (9 years ago)
Author:
achristensen@apple.com
Message:

Disable URLParser logs by default in all builds
https://bugs.webkit.org/show_bug.cgi?id=163135

Reviewed by Brady Eidson.

In debug builds with the URLParser enabled, some tests time out because
parameters to generate log strings are being evaluated for each character of each URL
and then not being used if URLParser logs are disabled. Generating these unused parameters
is too slow even for debug builds. Let's only generate them if they are to be used.

No change in behaviour.

  • platform/URLParser.cpp:

(WebCore::URLParser::parse):
(WebCore::URLParser::allValuesEqual):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r206922 r206924  
     12016-10-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        Disable URLParser logs by default in all builds
     4        https://bugs.webkit.org/show_bug.cgi?id=163135
     5
     6        Reviewed by Brady Eidson.
     7
     8        In debug builds with the URLParser enabled, some tests time out because
     9        parameters to generate log strings are being evaluated for each character of each URL
     10        and then not being used if URLParser logs are disabled.  Generating these unused parameters
     11        is too slow even for debug builds.  Let's only generate them if they are to be used.
     12
     13        No change in behaviour.
     14
     15        * platform/URLParser.cpp:
     16        (WebCore::URLParser::parse):
     17        (WebCore::URLParser::allValuesEqual):
     18
    1192016-10-07  Andreas Kling  <akling@apple.com>
    220
  • trunk/Source/WebCore/platform/URLParser.cpp

    r206887 r206924  
    3434namespace WebCore {
    3535
     36#define URL_PARSER_DEBUGGING 0
     37   
     38#if URL_PARSER_DEBUGGING
     39#define URL_PARSER_LOG(...) LOG(URLParser, __VA_ARGS__)
     40#else
     41#define URL_PARSER_LOG(...)
     42#endif
     43   
    3644template<typename CharacterType>
    3745class CodePointIterator {
     
    11511159void URLParser::parse(const CharacterType* input, const unsigned length, const URL& base, const TextEncoding& encoding)
    11521160{
    1153     LOG(URLParser, "Parsing URL <%s> base <%s> encoding <%s>", String(input, length).utf8().data(), base.string().utf8().data(), encoding.name());
     1161    URL_PARSER_LOG("Parsing URL <%s> base <%s> encoding <%s>", String(input, length).utf8().data(), base.string().utf8().data(), encoding.name());
    11541162    m_url = { };
    11551163    ASSERT(m_asciiBuffer.isEmpty());
     
    11961204    };
    11971205
    1198 #define LOG_STATE(x) LOG(URLParser, "State %s, code point %c, parsed data <%s> size %zu", x, *c, parsedDataView(0, currentPosition(c)).utf8().data(), currentPosition(c))
    1199 #define LOG_FINAL_STATE(x) LOG(URLParser, "Final State: %s", x)
     1206#define LOG_STATE(x) URL_PARSER_LOG("State %s, code point %c, parsed data <%s> size %zu", x, *c, parsedDataView(0, currentPosition(c)).utf8().data(), currentPosition(c))
     1207#define LOG_FINAL_STATE(x) URL_PARSER_LOG("Final State: %s", x)
    12001208
    12011209    State state = State::SchemeStart;
     
    14441452                    auto findLastAt = c;
    14451453                    while (!findLastAt.atEnd()) {
    1446                         LOG(URLParser, "Finding last @: %c", *findLastAt);
     1454                        URL_PARSER_LOG("Finding last @: %c", *findLastAt);
    14471455                        if (*findLastAt == '@')
    14481456                            lastAt = findLastAt;
     
    18061814        case State::Fragment:
    18071815            do {
    1808                 LOG(URLParser, "State Fragment");
     1816                URL_PARSER_LOG("State Fragment");
    18091817                if (!m_didSeeUnicodeFragmentCodePoint && isASCII(*c))
    18101818                    appendToASCIIBuffer(*c);
     
    20502058    }
    20512059    m_url.m_isValid = true;
    2052     LOG(URLParser, "Parsed URL <%s>", m_url.m_string.utf8().data());
     2060    URL_PARSER_LOG("Parsed URL <%s>", m_url.m_string.utf8().data());
    20532061}
    20542062
     
    27802788    // FIXME: m_cannotBeABaseURL is not compared because the old URL::parse did not use it,
    27812789    // but once we get rid of URL::parse its value should be tested.
    2782     LOG(URLParser, "%d %d %d %d %d %d %d %d %d %d %d %d %s\n%d %d %d %d %d %d %d %d %d %d %d %d %s",
     2790    URL_PARSER_LOG("%d %d %d %d %d %d %d %d %d %d %d %d %s\n%d %d %d %d %d %d %d %d %d %d %d %d %s",
    27832791        a.m_isValid,
    27842792        a.m_protocolIsInHTTPFamily,
Note: See TracChangeset for help on using the changeset viewer.