bring speed back into KConfig

Jakub Stachowski qbast at go2.pl
Thu Apr 17 23:24:58 BST 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-core-devel/attachments/20080418/b41b13ce/attachment.patch>
-------------- next part --------------
_______________________________________________
Kde-optimize mailing list
Kde-optimize at kde.org
https://mail.kde.org/mailman/listinfo/kde-optimize


More information about the kde-core-devel mailing list