Review Request: little faster sycoca

Jaime Torres Amate jtamate at gmail.com
Wed Sep 28 18:14:03 BST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102723/
-----------------------------------------------------------

(Updated Sept. 28, 2011, 5:14 p.m.)


Review request for kdelibs.


Changes
-------

I've made some more changes (now it is only takes 12% in a Debug compilation)..Thanks,Rolf, for the hints.
Changed l by le (to avoid one vs l mistakes).
Basically, now it does what the comment says. I've changed pos=-posInt-1 with -(postInt-1) in hasKey because it crashed after the following change in calcDiversity:
if posInt<0 then pos=-posInt to access key[le-pos]. (from le-1 to 0)

It is a Debug profile, not a Release_debug as I thinked,
In fact, these are the g++ options (from a ps uax| grep g++)
-m64 -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline -Wl,--enable-new-dtags

I've come to it by luck..the NOTE comment and looking at QBitArray documentation, because
I'm looking to fix my constant warning: mime type inode/directory .... not found. (not found because the files are deleted by some process).


Description
-------

Using this way to build a for loop: for (const_iterator it=list.constBegin, end=list.constEnd ; it != end; ++it)
and replacing the count of bits with the QBitArray method for doing that.
callgrind says:
before: 2984 calls to constBegin, 0,00%. 2960531 calls to constEnd, 2.33%
after: 2921 calls to constBegin, 0,00%. 2921 calls to constEnd, 0.00%

before: calcDiversity, 55.83%  (debug enabled)
after: calcDiversity, 14,46%  (debug enabled)

buildsycoca is still not faster than light, but it is only a four lines patch.


Diffs (updated)
-----

  kdecore/sycoca/ksycocadict.cpp 17ed9ac 

Diff: http://git.reviewboard.kde.org/r/102723/diff/diff


Testing
-------


Thanks,

Jaime Torres Amate

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110928/f2d3204a/attachment.htm>


More information about the kde-core-devel mailing list