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:
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