Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9ad44599784a7ab2e46317f371e0c33b667906fe
      
https://github.com/WebKit/WebKit/commit/9ad44599784a7ab2e46317f371e0c33b667906fe
  Author: Chris Dumez <cdu...@apple.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp
    M Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp

  Log Message:
  -----------
  Stop using StringView::operator[] in hot code paths in WebCore
https://bugs.webkit.org/show_bug.cgi?id=263216

Reviewed by Darin Adler.

Stop using StringView::operator[] in hot code paths in WebCore. StringView's
operator[] is not super efficient because it needs to check the is8Bit flag for
every character when iterating. I am also looking into adding a boundary check
in StringView::operator[], which would further increase branching.

* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::moveToNextNonWhitespacePosition):
(WebCore::Layout::InlineItemsBuilder::handleTextContent):
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::canUseSimplifiedTextMeasuringForCharacters):
(WebCore::Layout::TextUtil::canUseSimplifiedTextMeasuring):
* Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::canUseSimplifiedTextMeasuringForCharacters):
(WebCore::Layout::canUseSimplifiedTextMeasuring):

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to