[Direct Receiver] Utilizing Subtle Behaviour for DirectReceiver

99 views
Skip to first unread message

Nafis Abedin

unread,
Jul 14, 2025, 10:24:35 AMJul 14
to chromi...@chromium.org, Daniel Cheng
Hi chromium-mojo,

Wanted some thoughts about utilizing this "even more subtle" part of Direct Receiver.

Recently, for Chrome Android, we experimented with direct non-root CompositorFrameSink messages going to VizCompositor and are seeing really good results for Mojo E2E latency for that thread. Therefore, I was thinking of extending the experiment to root CompositorFrameSink. This interface is associated with FrameSinkManager which in turn handles the binding of a lot (6 - including non-root CompositorFrameSink) of other interfaces.

From what I've seen from the code/traces, everything FSM handles is bound to VizCompositor so we end up with a bunch of direct receivers. Once I converted it to a direct receiver, most messages arriving at VizCompositor became direct.

There's an ongoing discussion with graphics, but I'm curious about any potential concerns from the Mojo side of things. Happy to work on any feature changes/safety measures we would like to have in-place before experimentation if needed :)

--

Thanks,
Nafis




Nafis Abedin

Software Engineer, Clank Performance

nafis...@google.com



Joe Mason

unread,
Jul 14, 2025, 6:09:24 PMJul 14
to Nafis Abedin, chromi...@chromium.org, Daniel Cheng
We've seen on desktop that DirectReceiver can improve E2E latency but cause some scroll jank due to congestion on the receiving thread. Our theory is that messages that were artificially spaced out due to task posting delays can now flood the receiving thread. (This causes more visible scroll jank on desktop than Android because of implementation differences in scrolling.)

Forcing everything to go through an extra thread hop just to avoid congestion is obviously not a good long-term design - it's just coincidence that the thread hops already existed and mitigated the flooding. Instead if the jank is big enough to be a problem we should implement some kind of throttling or batching. And so far the minor congestion increases haven't been enough to worry about that.

But in this case I'd worry that converting a LOT of interfaces to DirectReceiver in one shot might add more congestion, so watch out for that.

--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CACm-repSnDJX02fyx86c7CqWCiJ91E77e1PwD7ny68241e-oag%40mail.gmail.com.

Nafis Abedin

unread,
Jul 15, 2025, 3:26:54 PMJul 15
to Joe Mason, chromi...@chromium.org, Daniel Cheng
Thanks for the callout! Will keep that in mind if we proceed to experiment with this, especially as other platforms become involved.

On the topic of more visible scroll jank for Android vs Desktop: I wonder if slower mojo messages in general on Android compared to other platforms could have been a factor to lessen the impact of the flooding?
Reply all
Reply to author
Forward
0 new messages