KConfigIniBackend::stringToPrintable optimization patch

Vyacheslav Tokarev slava-t at gorodok.net
Thu May 28 03:50:57 BST 2009


Hi,

	While doing some profiling of konq I've seen that 
KConfigIniBackend::stringToPrintable method is quite hot at config writing and 
mostly due to the not-inlined QByteArray::append() method. The good thing is 
that we already now maximal possible size of the result, and currently we 
guarantee that append() won't cause data reallocation, though method call is 
still slow.
	I propose to implement stringToPrintable at lower level, using 
QByteArray::data() directly. You can see that in the attached patch which is 
quite simple. I didn't measure the performance gain from the optimization by 
separate test, but saw an expected improvement during general profiling.
	Please review it, and if it's ok can I commit?

Thanks,
Vyacheslav Tokarev (vtokarev)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfig.patch
Type: text/x-patch
Size: 3092 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090528/9b0c1cf2/attachment.bin>


More information about the kde-core-devel mailing list