D28933: [Coding] Avoid recurrent detach and size checks
Stefan BrĂ¼ns
noreply at phabricator.kde.org
Sat Apr 18 01:22:35 BST 2020
bruns created this revision.
bruns added reviewers: Baloo, ngraham.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
bruns requested review of this revision.
REVISION SUMMARY
QVector::append() is quite expensive, as each access checks if the array
needs to be detached or has to grow. Resizing the array and setting
the elements with an iterator is significantly faster.
TEST PLAN
valgrind --tool=callgrind baloosearch the_test.txt
REPOSITORY
R293 Baloo
BRANCH
submit
REVISION DETAIL
https://phabricator.kde.org/D28933
AFFECTED FILES
src/codecs/coding.cpp
To: bruns, #baloo, ngraham
Cc: kde-frameworks-devel, hurikhan77, lots0logs, LeGast00n, cblack, fbampaloukas, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200418/5ef2ae67/attachment.html>
More information about the Kde-frameworks-devel
mailing list