[webkit-changes] [WebKit/WebKit] 80f6e2: Allocating a new IPC::Semaphore for each RemoteIma...

mattwoodrow noreply at github.com
Mon Jul 24 15:09:55 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 80f6e24ca1d10903db9e2c76dd6ea91249a45d9f
      https://github.com/WebKit/WebKit/commit/80f6e24ca1d10903db9e2c76dd6ea91249a45d9f
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-07-24 (Mon, 24 Jul 2023)

  Changed paths:
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.cpp

  Log Message:
  -----------
  Allocating a new IPC::Semaphore for each RemoteImageBufferProxy::flushDrawingContextAsync adds significant overhead.
https://bugs.webkit.org/show_bug.cgi?id=259433
<rdar://112743547>

Reviewed by Dean Jackson.

Frequently we have an existing pending flush object, where the semaphore has already been signaled.

This makes the m_signaled bool atomic, so that we can check for completed flush objects without taking
the lock and blocking. This will still be false if the existing use of the semaphore hasn't yet been signaled,
or if the waitFor call failed.

If we find a completed flush objects, then moves the semaphore across into the new one to prevent a new allocation.

* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.cpp:
(WebKit::RemoteImageBufferProxyFlushFence::tryTakeSemaphore):
(WebKit::RemoteImageBufferProxy::flushDrawingContextAsync):
(WebKit::RemoteImageBufferProxyFlushFence::WTF_GUARDED_BY_LOCK): Deleted.

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




More information about the webkit-changes mailing list