Re: Snappy GUI response

Soeren Sandmann <[email protected]>
Newsgroups gmane.comp.xfree86.forum
Message-ID <[email protected]>
On Fri, 2003-07-04 at 17:47, Owen Taylor wrote:

> >    With FVWM I can move windows around and I never see the server 
> > repainting anything.  It's all seemless.  With more modern window
> > managers I get to watch things get repainted.  This isn't because
> > X is slow.  I can verify that it's not falling back to software for
> > anything.  This is slow because window managers are getting expose 
> > events for everything and handling them badly.  Maybe better scheduling
> > at the kernel level will help a little, but that's not the root of
> > the problem.
> 
> I'm really quite confused here about how the window manager can
> affect application repaint performance...
> 
> What you may well be seeing is bad X server scheduling between the
> window manager and application contents... once repainting window
> manager frames takes a significant amount of time, opaque resize
> becomes a fairly hard scheduling problem.

I think the same thing may be part of the problem where dragging (not
resizing) windows around results in big delays before applications
redraw themselves. The formula for calculating the delay before an
application redraws itself is the same as I wrote about [1] on the
wm-spec list a while back:

	n = P_a / (M - t_WM)

where P_a is the time an application takes to repaint, M is the time
between two consecutive mouse motion events and t_WM is the time the
window manager takes to handle a motion event. n is the number of mouse
events it takes from an application is first exposed until it is
repainted. As t_WM tends to M, n tends to infinity.

So the window manager _can_ affect (perceived) application redraw
performance. If everything is seemless with FVWM, then applications can
reapint quickly enough, and metacity is to blame (and as there is quite
a bit of fairly low-hanging fruit in it, I'm not too surprised ...)

The formula above is valid because the X server aggressively schedules
the window manager and starves everything else since the window manager
is getting input events. Maybe scheduling clients that get expose events
a bit more aggressively is an idea.


Soeren

[1]
http://mail.gnome.org/archives/wm-spec-list/2002-December/msg00025.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.