Latency and nesting
Daniel van Vugt
daniel.van.vugt at canonical.com
Mon Oct 28 02:33:00 UTC 2013
Has anyone else noticed there's a number of context switches between a
client rendering a frame and it finally reaching the framebuffer?
Obviously there's a minimum of one, since the client and server will be
different processes. But I'm concerned about the increased latency we're
imposing by other threads. The server takes an additional context switch
internally to pass a buffer swap from "frontend" to the backend
As for clients, I think they stay in the same thread for rendering and
sending data to the server. So that's good. But clients suffer a similar
problem whereby incoming data from the server is in a different thread
to that where the rendering (probably) happens.
I suspect these context switches, when compounded, could become
significant to input (touch!) latency. And nesting will multiply the
So we should be keep this in mind going forward, and try to avoid adding
any more context switches between threads.
More information about the Mir-devel