optimization of TextLineData::attribute
Summary:
Use a binary search for the needed Attribute.
Also moved the implementation from the header.
From 76,84% of cpu
to 0.08% of cpu
in callgrind doing the following:
Open an XML file with 4 lines and a line of 566039 characters long.
Accept to reopen the file, move to the end of the file (ctrl+end), and close.
The time difference can also be noticed in the autotests.
Test Plan:
Open a XML file with 4 lines and a line of 566039 characters long.
Accept to reopen the file, move to the end of the file (ctrl+end), and close.
Reviewers: Frameworks, Kate, cullmann
Reviewed By: Kate, cullmann
Subscribers: anthonyfieroni, dhaumann, mwolff, cullmann
Tags: Kate, Frameworks
Differential Revision: https://phabricator.kde.org/D11487