[Android WebView] Use one BeginFrame synchronous IPC per renderer process |
||||
Issue descriptionThe vsync ipc is synchronous, and right now there is one per webview per frame. Apps like inbox and feedly can have many webviews drawing, so the cost of one ipc per frame really adds up. We should instead have one per renderer process instead. sievers fyi
,
Mar 21 2016
Yeah, this means webview can't reuse BeginFrame plumbing in RWHVA. Multiple webviews is more similar to multiple windows than OOPIF. For multiple renderer processes, I was daydreaming about sending them in parallel, and blocking for all the replies, which kinda requires inventing a new way to do sync IPC.
,
Mar 21 2016
That's really unfortunate to not be able to reuse BeginFrame plumbing and it will definitely be at odds with how every other platform will work. Do you have any more docs or information about how you want this to work?
,
Mar 21 2016
No docs.. I just had this thought last friday when looking at a trace from inbox. Basically, begin frame IPC in sync compositor is synchronous, so blocks on the UI thread and has pretty high overhead. And this is just one idea for reducing the number of sync IPCs per frame. Other than using a sync IPC, webview begin frame is the same as chrome. Actually, maybe re-using RWHVA is possible: In the regular "BeginFrame" call, webview just registers that a sync compositor needs BeginFrame for this frame. Then if there is a separate call at the end of vsync to say "all begin frames have been called", then sync compositor can use that as a flush and send only a single IPC. Hmm, that actually sounds better..
,
Mar 21 2016
> Basically, begin frame IPC in sync compositor is synchronous, so blocks on the UI thread why does BeginFrame block? We could also see how this behaves with Mojo which doesn't need to bounce to the sender IO thread.
,
Mar 21 2016
> why does BeginFrame block? Any scroll from compositor for that frame must be synchronized back to the UI thread in vsync. Otherwise, the gmail behavior where gmail scrolls other native views to the webview scroll offset breaks.
,
Jul 19 2016
Has a CL: https://codereview.chromium.org/2160743002/
,
Jul 19 2016
Still going to share BeginFrame implementation as chrome. This bug only refers to the webview-only *synchronous* IPC that's sent after chrome's async begin frame IPC.
,
Jul 29 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3dd3ca72f1a2c3211177c72aae2d5027d8217769 commit 3dd3ca72f1a2c3211177c72aae2d5027d8217769 Author: boliu <boliu@chromium.org> Date: Fri Jul 29 00:18:37 2016 sync compositor: Reduce begin frame sync IPC overhead By making the begin frame sync IPC per renderer process rather than per compositor. Convert SyncCompositorMsg_SynchronizeRendererState to a control message, with a list of routing_ids as input, and a list of SyncCompositorCommonRendererParams as output. Introduce SynchronousCompositorRPHObserver which is tied to the lifetime of the RenderProcessHost, which is the browser side handler of control messages. SynchronousCompositorFilter serves as the renderer side control message handler. SynchronousCompositorRPHObserver adds itself as a vsync observer for the duration of a single vsync. Then its OnVSync callback is called after SynchronousCompositorHosts, where the single synchronous IPC is sent. BUG= 596235 Review-Url: https://codereview.chromium.org/2160743002 Cr-Commit-Position: refs/heads/master@{#408528} [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/browser/android/synchronous_compositor_host.cc [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/browser/android/synchronous_compositor_host.h [add] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/browser/android/synchronous_compositor_observer.cc [add] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/browser/android/synchronous_compositor_observer.h [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/browser/bad_message.h [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/browser/renderer_host/render_widget_host_view_android.cc [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/common/android/sync_compositor_messages.cc [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/common/android/sync_compositor_messages.h [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/content_browser.gypi [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/renderer/android/synchronous_compositor_filter.cc [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/renderer/android/synchronous_compositor_filter.h [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/renderer/android/synchronous_compositor_proxy.cc [modify] https://crrev.com/3dd3ca72f1a2c3211177c72aae2d5027d8217769/content/renderer/android/synchronous_compositor_proxy.h
,
Jul 29 2016
|
||||
►
Sign in to add a comment |
||||
Comment 1 by siev...@chromium.org
, Mar 21 2016Summary: [Android WebView] Use one BeginFrame IPC per renderer process (was: [Android WebView] Use one vsync IPC per renderer process)