[Webkit-unassigned] [Bug 86165] New: HTML parser should yield more to improve perceived page load time
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu May 10 18:13:13 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=86165
Summary: HTML parser should yield more to improve perceived
page load time
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
OS/Version: Unspecified
Status: NEW
Keywords: Performance
Severity: Normal
Priority: P2
Component: WebCore Misc.
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: tonyg at chromium.org
CC: koivisto at iki.fi, abarth at webkit.org,
simonjam at chromium.org, mihaip at chromium.org,
sullivan at chromium.org
Created an attachment (id=141305)
--> (https://bugs.webkit.org/attachment.cgi?id=141305&action=review)
Testcase
The HTML parser has heuristics to yield to the event loop. Mihai P pointed out:
> Based on HTMLParserScheduler::checkForYieldBeforeToken it will yield after 4096 tokens _and_ at least 0.5 seconds have passed.
> There is also HTMLParserScheduler::checkForYieldBeforeScript which makes sure we paint at least once before running scripts.
The attached test case demonstrates 5 separate inline script blocks which each take 1s to execute. Sometimes we'll yield after the first, but we always lock the main thread after that (presumably until 4,096 tokens are reached) . Locking the main thread is bad for obvious reasons (can't paint, schedule resource loads, etc). This example isn't completely contrived, it bit a popular Google property.
I propose we change the logic so that if .5 seconds have passed we always schedule a yield for after the next token is parsed. This will avoid the user ever staring at a blank page for too long. Thoughts? Other heuristic ideas?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list