Hi,

I've recently become very concerned about the speed of application
loading when using certain X11 tookits.

On my travels, I've managed to pick up a fair bit of info, much
of which may have been misleading, or just plain wrong.

I think I may now be asking in the right place. Please correct
me if I'm misguided !

It seems that depending on the toolkit used, different X11 apps
take significantly different amounts of time to begin. By 'begin',
I mean map to the display.

I've checked the initialisation mechanisms of various toolkits
and found they're all practically the same. The delay experienced
before an application maps to the screen seems to take place
_before_ the code begins executing.

So here is my (current) conclusion - that may or may not be correct:

The amount of time it takes for an X11 app to map to the screen
is a function of the amount of symbols in the shared libraries
it loads.

Does this sound reasonable ?

If this is the case, does it mean that ld.so is responsible for
this delay ?

To do a real-world test, I tried creating a 4-line app to create
and map an X11 window. I did this with the GTK and Qt toolkits.

I'm afraid my measurement is only done by perception. If anyone
can tell me how to perform proper measurements, I'll go away
and try again :)

Basically, a GTK app maps to the screen almost instantly. The
delay is imperceptible - the window maps before your finger
leaves the return key.

A Qt app takes significantly longer. On my machine, the delay
seems to be about 1/2 to 1 second.

My attempt at measuring the number of symbols in the libraries
used follows.

I ran objdump --dynamic-syms on the libraries used by two 'hello, world'
apps.

Note: I ignored any extra libs with a tiny number of symbols (libICE, etc)

Qt: libqt
Total symbols: 9927

GTK: libglib libgtk libgdk
Total symbols: 3052

So it looks like libqt has 3 times the number of symbols as the various
GTK-related libraries combined.

I'm not convinced I've worked this out properly - It doesn't
seem quite logical to me that 3 times the number of symbols should
produce such a disparity in load time.

While this doesn't make perfect sense to me, nothing else seems
to add up either. Because I don't know how much of a difference a
large number of symbols makes, I'm asking here !

Am I looking in the right direction, blaming ld.so ? Or should I
look elsewhere ? Any pointers appreciated !

Cheers,
Rik

Reply via email to