[webkit-changes] [WebKit/WebKit] 8f6d89: [IFC] Cache canUseSimplifiedTextMeasuring on Rende...

Alan Baradlay noreply at github.com
Sun Aug 20 20:58:15 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8f6d89b32a384de3e053e307f02bf4120a648575
      https://github.com/WebKit/WebKit/commit/8f6d89b32a384de3e053e307f02bf4120a648575
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-08-20 (Sun, 20 Aug 2023)

  Changed paths:
    M Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp
    M Source/WebCore/rendering/RenderText.cpp
    M Source/WebCore/rendering/RenderText.h

  Log Message:
  -----------
  [IFC] Cache canUseSimplifiedTextMeasuring on RenderText
https://bugs.webkit.org/show_bug.cgi?id=260426

Reviewed by Antti Koivisto.

1. Computing canUseSimplifiedTextMeasuring is an expensive operation (it may iterate through all the glyphs of the text content)
2. We used to cache this information on RenderText (see 260675 at main) and now it's computed at BoxTree building.
3. Due to eager (IFC integration) invalidation, we destroy BoxTree in cases where we still keep associated RenderText renderers alive.

~10% progression on PerformanceTests/Layout/line-layout-preferred-width-break-all.html

* PerformanceTests/Layout/line-layout.html:
* Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::createLayoutBox):
* Source/WebCore/rendering/RenderText.cpp:
(WebCore::RenderText::setRenderedText):
* Source/WebCore/rendering/RenderText.h:
(WebCore::RenderText::setCanUseSimplifiedTextMeasuring):
(WebCore::RenderText::canUseSimplifiedTextMeasuring const):

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




More information about the webkit-changes mailing list