<table><tr><td style="">jtamate added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D11487">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D11487#231522" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D11487#231522</a>, <a href="https://phabricator.kde.org/p/mwolff/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@mwolff</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p><a href="https://phabricator.kde.org/p/jtamate/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@jtamate</a> looking at your screenshots, it represents closely what I see locally. Most notably, there are no red underlines in your screenshots which could arise due to spell checking. Thus I really wonder why you are seeing such a big hotspot there.</p>

<p>Try perf, or try a poor mans profiler like GDB and regularly interrupt. Do you really end up in <tt style="background: #ebebeb; font-size: 13px;">TextLineData::attribute()</tt>? Or, alternatively: Measure the time it takes for kate/kwrite to open the file and then go to the end. Then compare this before and after your patch. Do you see anything in the order of ~75% reduction for the time then too? Note how callgrind only measure instructions, so a supposed reduction of 75% of instructions should certainly have an impact on time too - of course not 75% too... I simply cannot fathom why you are seeing such an impact but I cannot reproduce this at all!</p></div>
</blockquote>

<p>I've done some measurements, as the times are so big, with a stopwatch 2 times each test.<br />
With "Enable autodetection of Language" and "Automatic spell checking enabled by default" enabled,<br />
the test as before: since pressing "Temporarily raise limit and reload file", press Ctrl+end and finish the scroll to the end of the document.</p>

<p>without any version of the patch:<br />
1 min 25 seconds <br />
With <span class="phabricator-remarkup-mention-unknown">@mwolf</span> solution, used only in spellCheckWrtHighlightingRanges.<br />
38 seconds<br />
With the binary search:<br />
34 seconds</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R39 KTextEditor</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11487">https://phabricator.kde.org/D11487</a></div></div><br /><div><strong>To: </strong>jtamate, Frameworks, Kate<br /><strong>Cc: </strong>anthonyfieroni, dhaumann, mwolff, cullmann, michaelh, kevinapavew, ngraham, demsking, sars<br /></div>