>>>>> Rik Hemsley writes:

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

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

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

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

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

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

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

Rik> Does this sound reasonable ?

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

You can check this yourself if you're using glibc 2.1.x on an i686
compiled for an i686:
$ LD_DEBUG=statistics ls
13661:
13661:  runtime linker statistics:
13661:    total startup time in dynamic loader: 714186 clock cycles
13661:              time needed for relocation: 480435 clock cycles (67.2%)
13661:                   number of relocations: 289
13661:             time needed to load objects: 152416 clock cycles (21.3%)

If glibc was compiled for i386, you only get:
$ LD_DEBUG=statistics ls
13662:                   number of relocations: 289

But I don't think this shows the problem. 

I do advise to start profiling your libs to see where the time is
spend.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs [EMAIL PROTECTED]
   private [EMAIL PROTECTED]

Reply via email to