D12511: optimization of KTextEditor::DocumentPrivate::views()
Jaime Torres Amate
noreply at phabricator.kde.org
Wed Apr 25 08:45:07 UTC 2018
jtamate created this revision.
jtamate added a reviewer: Kate.
Restricted Application added projects: Kate, Frameworks.
Restricted Application added a subscriber: Frameworks.
jtamate requested review of this revision.
REVISION SUMMARY
Calculate the list of keys of a hash table is quite expensive.
It is cheaper to keep that list and change it when a view is created or removed.
TEST PLAN
Run kwrite and paste a relative long text several times and then undo until the text is empty, with only one view.
Before: F5821740: kwrite_before.png <https://phabricator.kde.org/F5821740> it used 65% of cpu in Kate::TextBuffer::notifyAboutRangeChange
After: F5821746: kwrite_after.png <https://phabricator.kde.org/F5821746> it uses 19% of cpu in in Kate::TextBuffer::notifyAboutRangeChange
REPOSITORY
R39 KTextEditor
REVISION DETAIL
https://phabricator.kde.org/D12511
AFFECTED FILES
src/document/katedocument.cpp
src/document/katedocument.h
To: jtamate, #kate
Cc: #frameworks, michaelh, kevinapavew, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180425/a9f6b6ce/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list