Nested procedures into X12

Adam Jackson ajax at nwnk.net
Wed Jun 17 08:10:23 PDT 2015


On Mon, 2015-06-15 at 09:46 +0200, SÅ‚awomir Lach wrote:
> I would like to suggest something, which could improve speed of X12
> protocol and maybe XServer too. My suggestions is the same idea, which
> makes databases works faster, OpenGL(via commands list) works faster
> and NoMachine NX works faster: nested procedures.

NX does not have stored procedures.

> I don't know, which language you will select to writing nested
> procedures. I think, that my idea could improve speed of data exchange
> over network. It could also improve speed of X subsystem, because
> window manager could declare nested procedure, which could be compiled
> and no needs to send signals into window manager. We can drop whole
> code of supporting window manager from X Server and suggest Window
> Manager developers to attach nested procedures to events of X Server.
> Maybe just drop as many messages as we can and force to use nested
> procedures to make X Server implementation simpler? I don't know, but
> my idea seems to be very mad.

Can you provide an example of a workload where the window manager is a
performance problem?

Stored procedures in X11 don't win you much; very little of the
workload is blocked on round trips.  You could do something along the
lines of DBE's "idiom" concept to amortize the cost of resource lookup
over multiple requests, but that's typically not a big win.  For
something 'x11perf -query' for instance, where you're just doing
QueryPointer in a loop, the dixLookupWindow call is about 7% of your
xserver CPU time.  QueryPointer is about as trivial of a request as
we've got, more complicated requests would benefit even less.

I'd much prefer to identify the actual performance issues with the
protocol and add extension requests to fix those.  PropertyNotify, for
instance, will get sent for any property change on a window (even for
properties you don't care about), and includes only the atom naming the
property and not its content (which you probably want).  So not only
does it make you round-trip, it also causes a thundering herd.

In general the lesson from X11 has been that rendering API and
complicated logic in the server was a mistake; that once you hit 60fps
fairness is more important than throughput; and that requests should be
asynchronous and execute in small, bounded time.  Stored procedures
encourage server-side logic and unbounded request execution time,
making it harder to ensure fairness.

Just because you're executing on a Turing machine doesn't mean every
program needs to implement one.

- ajax



More information about the xorg-devel mailing list