[webkit-changes] [WebKit/WebKit] 38d1d7: Optimize LocalFrameView::incrementVisuallyNonEmpty...

Chris Dumez noreply at github.com
Fri Sep 29 10:58:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 38d1d72e3b8a4123450e4f2c2a2966bf83a66c01
      https://github.com/WebKit/WebKit/commit/38d1d72e3b8a4123450e4f2c2a2966bf83a66c01
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-09-29 (Fri, 29 Sep 2023)

  Changed paths:
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/LocalFrameView.h

  Log Message:
  -----------
  Optimize LocalFrameView::incrementVisuallyNonEmptyCharacterCount()
https://bugs.webkit.org/show_bug.cgi?id=262368

Reviewed by Ryosuke Niwa.

Optimize LocalFrameView::incrementVisuallyNonEmptyCharacterCount():
- Add inline fast path when we've already reached the threshold.
- Templatize nonWhitespaceLength() to avoid repeated branching on
  is8Bit() inside String::operator[].

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::nonWhitespaceLength):
(WebCore::LocalFrameView::incrementVisuallyNonEmptyCharacterCountSlowCase):
(WebCore::LocalFrameView::incrementVisuallyNonEmptyCharacterCount): Deleted.
* Source/WebCore/page/LocalFrameView.h:
(WebCore::LocalFrameView::incrementVisuallyNonEmptyCharacterCount):

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




More information about the webkit-changes mailing list