Changeset 83940 in webkit
- Timestamp:
- Apr 14, 2011 8:48:42 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83939 r83940 1 2011-04-14 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Simon Fraser. 4 5 PumpSession should not call currentTime() in the constructor 6 https://bugs.webkit.org/show_bug.cgi?id=55211 7 8 currentTime() is expensive. So we avoid calling it in the constructor 9 and instead set startTime on the first check for a yield 10 (which in the synchronous case never happens, and in the yielding 11 case will happen immediately after the first token due to 12 processedTokens being set to INT_MAX). 13 14 This ended up being a large win on (my local copy of) 15 peacekeeper's domDynamicCreationCreateElement: 16 17 Before: 18 avg 366.3333333333333 19 median 366 20 stdev 2.712112747574399 21 min 362 22 max 377 23 24 After: 25 avg 345.96666666666664 26 median 346 27 stdev 1.6829207415152454 28 min 343 29 max 349 30 31 * html/parser/HTMLDocumentParser.cpp: 32 * html/parser/HTMLParserScheduler.h: 33 (WebCore::PumpSession::PumpSession): 34 (WebCore::HTMLParserScheduler::checkForYieldBeforeToken): 35 1 36 2011-04-14 Ami Fischman <fischman@google.com> 2 37 -
trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp
r83456 r83940 41 41 #include "NestingLevelIncrementer.h" 42 42 #include "Settings.h" 43 #include <wtf/CurrentTime.h>44 43 45 44 namespace WebCore { -
trunk/Source/WebCore/html/parser/HTMLParserScheduler.h
r80861 r83940 27 27 #define HTMLParserScheduler_h 28 28 29 #include <limits.h> 30 29 31 #include "NestingLevelIncrementer.h" 30 32 #include "Timer.h" … … 40 42 PumpSession(unsigned& nestingLevel) 41 43 : NestingLevelIncrementer(nestingLevel) 42 , processedTokens(0) 43 , startTime(currentTime()) 44 // Setting processedTokens to INT_MAX causes us to check for yields 45 // after any token during any parse where yielding is allowed. 46 // At that time we'll initialize startTime. 47 , processedTokens(INT_MAX) 48 , startTime(0) 44 49 , needsYield(false) 45 50 { … … 64 69 { 65 70 if (session.processedTokens > m_parserChunkSize) { 71 // currentTime() can be expensive. By delaying, we avoided calling 72 // currentTime() when constructing non-yielding PumpSessions. 73 if (!session.startTime) 74 session.startTime = currentTime(); 75 66 76 session.processedTokens = 0; 67 77 double elapsedTime = currentTime() - session.startTime;
Note: See TracChangeset
for help on using the changeset viewer.