Skip navigation.
Home

X.org slowness

Wondering why X takes so long to start up (and inspired by the smaller source tree since it went modular ;-), I did a little profiling tonight. Turns out that probing the PCI bus is taking quite a while (Debian/unstable's X.org). The last call to pciFindNext() was taking 1.7 seconds just to report no more devices!

I edited hw/xfree86/os-support/bus/Pci.c to this (14 was the number of the last call on my system), which removed the delay:

if (idx < 14)
	tag = pciFindNext();
else
	tag = PCI_NOT_FOUND;

Maybe just counting the lines in /proc/bus/pci/devices and stopping when we get that many would work?

Another slow looking bit is xf86OpenConsole (1.1 seconds), but I don't have time to investigate right now.

X.org traces

Here are four traces, showing each combination of this change and the patch from bug 6583:

http://www.ecs.soton.ac.uk/~tal/traces/

(ignore the last two points on each graph, as that just shows when I it ctrl-alt-backspace to exit!)

Summary:

Original: 5.99 s
With bugzilla patch: 5.07 s
With my change: 4.31 s
With both: 3.84 s

Traces

What's the program you did those traces with? It looks way cool :-)

Strace plotting script

It's Federico's strace-plotting script; see the Profiling entry...

Nice analysis. How abut

Nice analysis. How abut cooking a patch and attaching it to a new bug? :-)

Syndicate content