optimization of KTextEditor::DocumentPrivate::views()

Authored by jtamate on May 4 2018, 5:38 PM.

Description

optimization of KTextEditor::DocumentPrivate::views()

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:

it used 65% of cpu instructions in Kate::TextBuffer::notifyAboutRangeChange
After:
it uses 19% of cpu instructions in in Kate::TextBuffer::notifyAboutRangeChange

Reviewers: Kate, cullmann, mwolff

Reviewed By: Kate, mwolff

Subscribers: mwolff, cullmann, Frameworks

Tags: Kate, Frameworks

Differential Revision: https://phabricator.kde.org/D12511

Details

Committed
jtamateMay 4 2018, 5:40 PM
Reviewer
Kate
Differential Revision
D12511: optimization of KTextEditor::DocumentPrivate::views()
Parents
R39:7b6fe8c923a4: GIT_SILENT Upgrade KF5 version to 5.46.0.
Branches
Unknown
Tags
Unknown