kconfig and kde global config files

Lubos Lunak l.lunak at suse.cz
Tue Mar 7 13:13:58 GMT 2006

On Sunday 05 March 2006 05:48, Aaron J. Seigo wrote:
> On Saturday 04 March 2006 15:00, Lubos Lunak wrote:
> >   (0 benchmarking here too) I'd expect that the stats don't matter. You'd
> > have to do them once at app startup anyway, then they'd be cached by the
> > kernel and if done noticeably later they'd be lost in the noise anyway.
> including statting locations that didn't exist previously in the file
> system? is that also cached in the kernel? we move around between /etc,
> $PREFIX, $KDEDIRS and $KDEHOME, and often multiple locations in each ...

 I'd expect so (although that doesn't mean it's so and I wouldn't be that 
surprised it it wasn't).

> >   As for optimizing KConfig, I wonder if the problem rather isn't the way
> >  KConfig works, QMap usage specifically. When I benchmarked the KDE
> > startup last time it spent 10% time in KConfig (according to
> >  http://www.kdedevelopers.org/node/1661).
> it will be interesting to compare different backends here ...

 QMap is not a problem of backends. The frontend itself forces it.

> >  Memory usage isn't that nice either
> yes, there's a lot that can be made better here, especially in the case of
> multiple kconfig objects. which we often have due to the pervasive use of
> INI files to store information (.desktop files, icon themes, etc).
> >  brought by changing KConfig so that the INI backed could be rewritten to
> >  read-only mmap the files, implement readXYZ() by basically doing
> > strstr() on the file for just parsing the one needed line and having a
> > QMap (list, whatever) only for changed entries.
> you could save memory doing this, but there would likely be a hit on speed.

 That's actually questionable. It could very well be that on-demand reading of 
only required entries could be faster than reading the whole config.

> instead of doing changed entries only in the map one could also possibly
> cache previously read values. often times when a setting gets read once, it
> gets read multiple times in the app. hmm.. will have to experiment.

Lubos Lunak
KDE developer
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/

More information about the kde-core-devel mailing list