Dynamic symbol table

Karl Vogel karl.vogel at seagha.com
Thu Jul 15 23:55:59 CEST 2004


Frans Englich wrote:

> On Thursday 15 July 2004 21:09, Karl Vogel wrote:
>> Karl Vogel wrote:
>> > I noticed that a lot of the .so files have big dynamic symbol tables,
>> > as if everything is exported. Wouldn't it be better to only export the
>> > symbols that are really required?!
>>
>> Seems like it is indeed not needed. I've changed the Makefile.am of
>> some kcm modules to use a version script which only exports init_*
>> and create_* symbols.
> 
> A quick note: A half year ago a macro for factory declaration of KControl
> modules was proposed(to be declared in kcmodule.h), but postponed for KDE
> 4. If this optimization turns out useful, it could perhaps be part of such
> a declaration macro(I can look up the patch, if of interest).

I noticed that some modules used K_EXPORT_COMPONENT_FACTORY. As I first only 
had the create_* function exported, but the newer modules using the factory, 
export init_*

ie. kdelibs/kdecore/klibloader.h

#define K_EXPORT_COMPONENT_FACTORY( libname, factory ) \
    extern "C" { void *init_##libname() { return new factory; } }

But there is nothing to restrict the export of the other symbols yet... but 
maybe it was already on the KDE4 to-do list?!


Anyway I'm interested in reducing startup time.. and this seemed like a good 
starting point...

Has anybody done some detailed analysis yet as to where most time is wasted at 
startup?! Sprinkling 'date' commands in my startkde script shows that 
ksmserver is where I loose the most time... but that encompasses alot..  so 
time to dig into the ksmserver source (and related commands that are started 
by ksmserver)




More information about the Kde-optimize mailing list