bring speed back into KConfig

Jakub Stachowski qbast at go2.pl
Fri Apr 18 00:24:58 CEST 2008


Dnia czwartek, 17 kwietnia 2008, Olivier Goffart napisał:
> Le mardi 15 avril 2008, Dirk Mueller a écrit :
> > Hi,
> >
> > the "knotify4 eats cpu" bugreport seems to be highly popular, so the
> > reason for that seems to be the incredible performance loss in KConfigIni
> >  due to the "kconfig refactoring branch" being merged last autumn by
> > Andreas Pakulat.
>
> Oh, i though it was a problem in the xine backend, which is why i did not
> spend much attention to it.
> I may have a closer look.

I did some more optimizing to  minimize copying data around. Instead of using 
QByteArray everywhere I added class BufferFragment with very similar (bare 
minimum used by parser) API, but operating on allocated earlier big buffer. 
like left(), trim(), mid(), etc. are only pointer and int operations.

Results:
 - 500x parsing of kwin.notifyrc takes 1.3s instead of 5.8s
 - KConfig from KDE3 takes 1.4s 
 - kconfig unit test pass

BufferFragment class contains very short functions (most of them 1-3 lines) 
that could be inlined, so all definitions are in header file. Is it OK or 
separate .cpp file is necessary?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfig-opt.patch
Type: text/x-diff
Size: 11389 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20080418/b41b13ce/attachment.bin 


More information about the Kde-optimize mailing list