Skip to content

Conversation

@smfr
Copy link
Contributor

@smfr smfr commented Jun 22, 2023

e97b079

Lazily allocate the SharedVideoFrameWriter in RemoteDisplayListRecorderProxy
https://bugs.webkit.org/show_bug.cgi?id=258379
rdar://111133625

Reviewed by Youenn Fablet.

Every RemoteImageBufferProxy has a RemoteDisplayListRecorderProxy, and every RemoteDisplayListRecorderProxy has
a SharedVideoFrameWriter, which owns an IPC::Semaphore. The creation and destruction time for this semaphore
was significant when creating/destroying ImageBuffers.

Since SharedVideoFrameWriter is only rarely used, in the case where video frames are drawing into a buffer,
we can lazily allocate it.

* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp:
(WebKit::RemoteDisplayListRecorderProxy::recordPaintVideoFrame):
(WebKit::RemoteDisplayListRecorderProxy::disconnect):
(WebKit::RemoteDisplayListRecorderProxy::ensureSharedVideoFrameWriter):
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:

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

03c81f8

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv 🧪 mac-AS-debug-wk2
✅ 🛠 tv-sim
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@smfr smfr requested a review from cdumez as a code owner June 22, 2023 00:54
@smfr smfr self-assigned this Jun 22, 2023
@smfr smfr added the WebKit Process Model Bugs related to WebKit's multi-process architecture label Jun 22, 2023
@webkit-early-warning-system
Copy link
Collaborator

webkit-early-warning-system commented Jun 22, 2023

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 22, 2023
@smfr smfr removed the merging-blocked Applied to prevent a change from being merged label Jun 22, 2023
@smfr smfr force-pushed the eng/Lazily-allocate-the-SharedVideoFrameWriter-in-RemoteDisplayListRecorderProxy branch from 2bbae9b to 03c81f8 Compare June 22, 2023 19:26
@smfr smfr added the merge-queue Applied to send a pull request to merge-queue label Jun 22, 2023
…erProxy

https://bugs.webkit.org/show_bug.cgi?id=258379
rdar://111133625

Reviewed by Youenn Fablet.

Every RemoteImageBufferProxy has a RemoteDisplayListRecorderProxy, and every RemoteDisplayListRecorderProxy has
a SharedVideoFrameWriter, which owns an IPC::Semaphore. The creation and destruction time for this semaphore
was significant when creating/destroying ImageBuffers.

Since SharedVideoFrameWriter is only rarely used, in the case where video frames are drawing into a buffer,
we can lazily allocate it.

* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp:
(WebKit::RemoteDisplayListRecorderProxy::recordPaintVideoFrame):
(WebKit::RemoteDisplayListRecorderProxy::disconnect):
(WebKit::RemoteDisplayListRecorderProxy::ensureSharedVideoFrameWriter):
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:

Canonical link: https://commits.webkit.org/265427@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Lazily-allocate-the-SharedVideoFrameWriter-in-RemoteDisplayListRecorderProxy branch from 03c81f8 to e97b079 Compare June 22, 2023 22:03
@webkit-commit-queue
Copy link
Collaborator

Committed 265427@main (e97b079): https://commits.webkit.org/265427@main

Reviewed commits have been landed. Closing PR #15170 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit e97b079 into WebKit:main Jun 22, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebKit Process Model Bugs related to WebKit's multi-process architecture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants