[webkit-changes] [WebKit/WebKit] b3f5cc: Speedometer 3: buildTransaction spends a lot of ti...

mattwoodrow noreply at github.com
Wed Mar 20 14:28:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b3f5ccb38cd2800b166d39aeb366186f94a38f93
      https://github.com/WebKit/WebKit/commit/b3f5ccb38cd2800b166d39aeb366186f94a38f93
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2024-03-20 (Wed, 20 Mar 2024)

  Changed paths:
    M Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.h
    M Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.messages.in
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp

  Log Message:
  -----------
  Speedometer 3: buildTransaction spends a lot of time destroying mach port objects.
https://bugs.webkit.org/show_bug.cgi?id=270549
<rdar://123661156>

Reviewed by Kimmo Kinnunen.

Flusing a RemoteImageBufferSetProxy waits on both the `didPrepareForDisplay` message
to be delivered to the WorkQueue, and the semaphore to be signaled when drawing command
flushing is completed.

This was previously required, since building of the transaction on the main thread was
blocked on the didPrepareForDisplay message, so it was delivered as early as possible.

The current state is that all waiting happens on a background thread, so there's no
longer any benefit to having two separate notifications.

This changes moves sending of the didPrepareForDisplay message to happen once drawing
flushing is completed, and removes the seamphore signaling.

This should be a small performance win in some cases, since we no longer need to allocate
and destroy the semaphore objects.

* Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.cpp:
(WebKit::RemoteImageBufferSet::RemoteImageBufferSet):
(WebKit::RemoteImageBufferSet::endPrepareForDisplay):
(WebKit::RemoteImageBufferSet::ensureBufferForDisplay):
(WebKit::RemoteImageBufferSet::setFlushSignal): Deleted.
(WebKit::RemoteImageBufferSet::flush): Deleted.
* Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.h:
* Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.messages.in:
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::prepareImageBufferSetsForDisplay):
(WebKit::RemoteRenderingBackend::prepareImageBufferSetsForDisplaySync):
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h:
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in:
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp:
(WebKit::RemoteImageBufferSetProxyFlushFence::create):
(WebKit::RemoteImageBufferSetProxyFlushFence::waitFor):
(WebKit::RemoteImageBufferSetProxyFlushFence::RemoteImageBufferSetProxyFlushFence):
(WebKit::RemoteImageBufferSetProxy::flushFrontBufferAsync):
(WebKit::RemoteImageBufferSetProxy::willPrepareForDisplay):
(WebKit::RemoteImageBufferSetProxyFlushFence::~RemoteImageBufferSetProxyFlushFence): Deleted.
(WebKit::RemoteImageBufferSetProxyFlushFence::tryTakeEvent): Deleted.
(WebKit::RemoteImageBufferSetProxyFlushFence::setWaitingForSignal): Deleted.
(): Deleted.
(WebKit::RemoteImageBufferSetProxy::createFlushFence): Deleted.
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::prepareImageBufferSetsForDisplay):

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



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


More information about the webkit-changes mailing list