[webkit-changes] [WebKit/WebKit] f17bb5: Tweak HTML parser yielding

Per Arne Vollan noreply at github.com
Wed Mar 15 13:02:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f17bb5ab82ff403ea4fbe2d88c6119b19b4aaab8
      https://github.com/WebKit/WebKit/commit/f17bb5ab82ff403ea4fbe2d88c6119b19b4aaab8
  Author: Per Arne Vollan <pvollan at apple.com>
  Date:   2023-03-15 (Wed, 15 Mar 2023)

  Changed paths:
    M LayoutTests/fast/forms/focus-option-control-on-page.html
    M Source/WebCore/html/parser/HTMLParserScheduler.cpp
    M Source/WebCore/html/parser/HTMLParserScheduler.h

  Log Message:
  -----------
  Tweak HTML parser yielding
https://bugs.webkit.org/show_bug.cgi?id=228780
rdar://81517847

Reviewed by Antti Koivisto.

Tweak html parser yielding to attempt to improve page load performance with respect to certain page load metrics.
This patch makes the parser yield if the page has not painted before and meaningful content has been loaded. Also
make sure that the parser only yields before executing scripts if there has been parsing progress since the last
yield. Measurements show that this is a 1-2% improvement in page load times. This change also revealed a race
condition in a test, where a call to notifyDone() in an inline script was racing with a call to waitForDone() in
a script with SRC attribute. This race was resolved by starting the test in the onload handler.

* LayoutTests/fast/forms/focus-option-control-on-page.html:
* Source/WebCore/html/parser/HTMLParserScheduler.cpp:
(WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
* Source/WebCore/html/parser/HTMLParserScheduler.h:

Canonical link: https://commits.webkit.org/261705@main




More information about the webkit-changes mailing list