bring speed back into KConfig

Jakub Stachowski qbast at go2.pl
Tue Apr 15 21:51:01 CEST 2008


Dnia wtorek, 15 kwietnia 2008, Dirk Mueller napisał:
> 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.
>
> The code now uses highlevel QByteArray operations 

Lots of reallocations and memory copies instead of simple moving of pointer.

> and even worse QFile 
> operations for operating on the .ini files. My testcase of kwin.notifyrc,
> this means:

Attached very simple patch cuts parsing time by ~50% (on hot cache). It reads 
whole config file in one go, like KDE3 did.
KDE3 also was able to mmap() file instead of reading it, but readAll() shows 
5% on profile (using google perftools) so there are still many bigger 
targets.

>
> 2000 lines of config
>
> resulting in
>
> 16000 ~QByteArray() and 16000 QByteArray() constructions
> 6000 syscalls (stat() and 2x llseek()) due to QFile::readLine and
> QFile::atEof()
> 8000 memcpy operations
>
> in time:
>
> 150ms KConfig4
> 45ms  via QSettings of Qt 4.4
> 29ms via KConfig3
>
> I think thats a bit under performing. Anyone interested in fixing the hot
> spots in that code? I think it is fairly obvious why the code is extremely
> slow. I wanted to take a look at it myself but I guess I'll run out of time
> before I get anywhere.
>
> Thanks,
> Dirk
> _______________________________________________
> Kde-optimize mailing list
> Kde-optimize at kde.org
> https://mail.kde.org/mailman/listinfo/kde-optimize
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfig-readall.patch
Type: text/x-diff
Size: 522 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20080415/4f12c05e/attachment.bin 


More information about the Kde-optimize mailing list