[Webkit-unassigned] [Bug 224609] HTML parser should yield more aggressively

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 20 09:02:58 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=224609

Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #429150|review?                     |review+
              Flags|                            |

--- Comment #12 from Darin Adler <darin at apple.com> ---
Comment on attachment 429150
  --> https://bugs.webkit.org/attachment.cgi?id=429150
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=429150&action=review

> Source/WebCore/ChangeLog:26
> +        Consider yielding before script execution after 16ms has elapsed and at least 256 tokens have been parsed.

This is very straightforward to read in the code.

> Source/WebCore/ChangeLog:28
> +        Only yield for synchronous scripts.
> +        Don't yield on very short inline scripts (this is an imperfect way to try to guess the execution cost).

This is harder to understand, so some comment would be good with the constant that defines a short inline script and the code that’s checks a script is synchronous. I really like the "this is an imperfect way to try to guess the execution cost" remark, the core of a classically helpful "why" comment, and similarly, a comment that says why we don't need to yield for async scripts would be a plus.

> Source/WebCore/html/parser/HTMLParserScheduler.cpp:123
> +    static const auto elapsedTimeLimit = 16_ms;
> +    static const auto tokenLimit = 256;
> +    static const auto inlineScriptLengthLimit = 1024;

Should use constexpr.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210520/458f8ef2/attachment.htm>


More information about the webkit-unassigned mailing list