Bug 262380 - RemoteDisplayListRecorder should lazily allocate a SharedVideoFrameReader
Summary: RemoteDisplayListRecorder should lazily allocate a SharedVideoFrameReader
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Process Model (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-29 10:16 PDT by Simon Fraser (smfr)
Modified: 2023-11-08 13:39 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2023-09-29 10:16:05 PDT
Every RemoteDisplayListRecorder currently has a SharedVideoFrameReader by value. 99% of them will never use it. so it should be allocated lazily.
Comment 1 Simon Fraser (smfr) 2023-09-29 10:16:47 PDT
There is some cost here to:

_kernelrpc_mach_port_mod_refs_trap
WTF::MachSendRight::MachSendRight(WTF::MachSendRight const&)
WebKit::SharedVideoFrameReader::SharedVideoFrameReader(WTF::RefPtr<WebKit::RemoteVideoFrameObjectHeap, WTF::RawPtrTraits<WebKit::RemoteVideoFrameObjectHeap>, WTF::DefaultRefDerefTraits<WebKit::RemoteVideoFrameObjectHeap>>&&, WebCore::ProcessIdentity const&, WebKit::SharedVideoFrameReader::UseIOSurfaceBufferPool)
WebKit::RemoteDisplayListRecorder::create(WebCore::ImageBuffer&, WTF::ObjectIdentifierGeneric<WebCore::RenderingResourceIdentifierType, WTF::ObjectIdentifierThreadSafeAccessTraits>, WebKit::RemoteRenderingBackend&)
WebKit::RemoteRenderingBackend::didCreateImageBuffer(WTF::Ref<WebCore::ImageBuffer, WTF::RawPtrTraits<WebCore::ImageBuffer>>)
Comment 2 Simon Fraser (smfr) 2023-09-29 10:22:04 PDT
I did the same on the other side of the connection in bug 258379.
Comment 3 Radar WebKit Bug Importer 2023-10-06 10:17:16 PDT
<rdar://problem/116586176>
Comment 4 Simon Fraser (smfr) 2023-11-07 18:00:42 PST
Pull request: https://github.com/WebKit/WebKit/pull/20141
Comment 5 EWS 2023-11-08 13:39:07 PST
Committed 270404@main (34b59cbee757): <https://commits.webkit.org/270404@main>

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