Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 38d1d72e3b8a4123450e4f2c2a2966bf83a66c01
      
https://github.com/WebKit/WebKit/commit/38d1d72e3b8a4123450e4f2c2a2966bf83a66c01
  Author: Chris Dumez <[email protected]>
  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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to