Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2bd61e2f1c05935f2600b9c0edac21f60783ce39
      
https://github.com/WebKit/WebKit/commit/2bd61e2f1c05935f2600b9c0edac21f60783ce39
  Author: Taher Ali <[email protected]>
  Date:   2025-04-16 (Wed, 16 Apr 2025)

  Changed paths:
    M LayoutTests/platform/gtk/TestExpectations
    M LayoutTests/platform/ios/svg/W3C-SVG-1.1/text-intro-05-t-expected.txt
    M LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-intro-05-t-expected.txt
    M LayoutTests/platform/wpe/TestExpectations
    A LayoutTests/svg/text/timeout-long-text-content-expected.txt
    A LayoutTests/svg/text/timeout-long-text-content.html
    M Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
    M Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h

  Log Message:
  -----------
  Fix high CPU usage for long SVG text workloads
https://bugs.webkit.org/show_bug.cgi?id=291574
rdar://147359331

Reviewed by Vitor Roriz.

SVGTextMetricsBuilder advances character by character,
instantiating SVGTextMetrics and calling FontCascade::width, which
creates a ComplexController. This occurs in a busy loop, creating and
discarding many ComplexControllers, which is expensive.

This optimization reuses a single ComplexController within the busy loop
to handle all complex text advances.

* Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::advanceComplexText):
(WebCore::SVGTextMetricsBuilder::measureTextRenderer):
* Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to