Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: def2f7e17e6caa5b7a7622725202e25e0b8d8000
      
https://github.com/WebKit/WebKit/commit/def2f7e17e6caa5b7a7622725202e25e0b8d8000
  Author: Brent Fulgham <[email protected]>
  Date:   2025-12-04 (Thu, 04 Dec 2025)

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

  Log Message:
  -----------
  [Intel] Clang x86 optimizer needs help with std::optional::value_or branch 
prediction
https://bugs.webkit.org/show_bug.cgi?id=303494
<rdar://problem/164102621>

Reviewed by Matthieu Dubet.

The code change in Bug 301103 introduced a mysterious performance regression on 
Intel.

Prior to that patch: usedZoom always held the value of style.usedZoom() (a 
float), and
used it. After the patch: usedZoom never holds a value, and so the code does a
std::forward of m_frame->pageZoomFactor() which is also just returning a float.

The difference is we always take the false branch for has_value(), when 
previously we
took the true branch. PGO would have captured this, so we always take the wrong 
path and
fail branch prediction.

Apple Silicon recovered performance after updating PGO, but Intel did not.

This patch helps the Intel optimizer with this branch prediction.

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::documentToAbsoluteScaleFactor const):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to