Kernel scheduling algorithm and X.Org performance

Adam Jackson ajax at nwnk.net
Wed Aug 31 10:45:38 PDT 2005


On Wednesday 31 August 2005 13:23, Alan Cox wrote:
> Its also not helped by the X server and EXA hopefully will improve that,
> nor by the lack of sneaky tricks like caching the current visible window
> top level surfaces as some other window systems do so that moves don't
> cause a redraw. This makes total sense on any sane sized machine but
> isn't handled by X. It doesn't help resizes of course.

EXA helps some, but it's still dirty.  Basic EXA plus xcompmgr -a helps 
massively.  Minus the tearing from lack of vsync, i128 + EXA + xcompmgr -a is 
about as smooth as you could hope for.  That's an eight year old card, for 
those of you who are keeping track.

> It seems to me the big argument here is for window manglers and maybe X
> to be smarter about batching events. That isn't helped by the fact X has
> no real "window is updated/current". It could be added as a window
> property between WM and toolkits that followed the same policy without
> having to whack on the X server and would also clean up problems with
> things like print to screen.

Batching might be nice but I'm really not convinced you need it.  X's 
effective timeslices are tiny (assuming you avoid software GL) and we rarely 
handle more than 12 events per Select/Wakeup/Dispatch/Block/Write cycle.  
Batching events reduces the number of times the server wakes up, but so what.  
X really is latency-bound, and the time you spend batching is time that the 
card isn't spending drawing.

> If you want smooth Mac like handling and have a decent video card/box
> then we should be caching the clipped areas of top level windows up to a
> certain size in the server.

Aqua's window model is almost exactly like X's model under Composite.  All 
windows are rendered to offscreen surfaces and the actual rendering process 
is governed by a compmgr.  They don't have a window hierarchy so they have it 
a little simpler.

As a trivial example, run Xdarwin under Aqua sometime.  On XAA systems, when 
apps stall and stop redrawing, they lose window contents, and if you drag the 
window offscreen and back on it'll be visibly damaged.  Xdarwin has no such 
braindamage because windows never get "obscured".

This isn't completely true of course, Aqua has a real focus model, so some 
windows will stop updating or change their widgets when they aren't focused; 
but you don't get region damage events the way you do with unComposite'd X, 
so you don't have to do the 70 kajillion round-trips to repaint.  _That_ is 
what kills us.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20050831/ca9dd14a/attachment.pgp>


More information about the xorg mailing list