Changeset 140079 in webkit
- Timestamp:
- Jan 17, 2013 6:00:52 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r140075 r140079 1 2013-01-17 Adam Barth <abarth@webkit.org> 2 3 BackgroundHTMLParser should go 18% faster on html-parser-srcdoc benchmark 4 https://bugs.webkit.org/show_bug.cgi?id=107201 5 6 Reviewed by Tony Gentilcore. 7 8 Prior to this patch, we would tokenize all the input before delivering 9 any tokens to the main thread. Effectively, that prevented the 10 background parser from running in parallel with the main thread. 11 12 This patch causes us to send tokens to the main thread periodically. 13 The constant in this patch is somewhat arbitrary. We'll need to tune it 14 later with more realistic workloads. 15 16 This patch improves the performance of the html-parser-srcdoc benchmark 17 by 18%. (This patch is based on Eric's work in 18 https://github.com/tonygentilcore/webkit/commit/072331194520c7770b5e34baefbbbba948834971.) 19 20 * html/parser/BackgroundHTMLParser.cpp: 21 (WebCore): 22 (WebCore::BackgroundHTMLParser::pumpTokenizer): 23 (WebCore::BackgroundHTMLParser::sendTokensToMainThread): 24 1 25 2013-01-17 Matt Falkenhagen <falken@chromium.org> 2 26 -
trunk/Source/WebCore/html/parser/BackgroundHTMLParser.cpp
r140055 r140079 47 47 48 48 #endif 49 50 // FIXME: Tune this constant based on a benchmark. The current value was choosen arbitrarily. 51 static const size_t pendingTokenLimit = 4000; 49 52 50 53 typedef const void* ParserIdentifier; … … 158 161 m_tokenizer->setShouldAllowCDATA(m_inForeignContent); 159 162 m_token.clear(); 160 } 161 162 #ifndef NDEBUG 163 checkThatTokensAreSafeToSendToAnotherThread(m_pendingTokens); 164 #endif 163 164 if (m_pendingTokens.size() >= pendingTokenLimit) 165 sendTokensToMainThread(); 166 } 165 167 166 168 sendTokensToMainThread(); … … 200 202 void BackgroundHTMLParser::sendTokensToMainThread() 201 203 { 204 if (m_pendingTokens.isEmpty()) { 205 ASSERT(!m_isPausedWaitingForScripts); 206 return; 207 } 208 209 #ifndef NDEBUG 210 checkThatTokensAreSafeToSendToAnotherThread(m_pendingTokens); 211 #endif 212 202 213 TokenDelivery* delivery = new TokenDelivery; 203 214 delivery->identifier = m_parserIdentifer;
Note: See TracChangeset
for help on using the changeset viewer.