<table><tr><td style="">sars 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/D14408">View Revision</a></tr></table><br /><div><div><p>Hmm... I'm not totally convinced ;)</p>
<p>Stopping the m_currItemTimer when we have an edit is good! We could also avoid starting the timer in cursorPositionChanged() if m_updateTimer is active.</p>
<p>What I'm not convinced about is the increasing of the m_currItemTimer timeout or to cache the first & last lines of the currently active item.</p>
<p>Reasons:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">The timer is restarted and not triggered as long as the cursor moves. It triggers only when the cursor has stopped for over 100ms. The limit could be just a bit higher than the key-repeat delay and we would just get two newActveItem() invocations. One at the start before the key-repeats have started and one at the end when the key is released.</li>
</ol>
<ol class="remarkup-list" start="2">
<li class="remarkup-list-item">I hope you don't usually have files with more than 1000 "symbols" and even if you would have 1000 symbols the time for looping through those would not be noticeable.</li>
</ol>
<p>Try adding a QElapsedTimer at the start of updateCurrTreeItem() and check at the end how much time it took. I bet for most files it does not ever go over 1ms (except if there is a kernel-scheduling pause)</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R40 Kate</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D14408">https://phabricator.kde.org/D14408</a></div></div><br /><div><strong>To: </strong>loh.tar, Kate, sars<br /><strong>Cc: </strong>sars, kwrite-devel, Kate, michaelh, kevinapavew, ngraham, demsking, cullmann, dhaumann<br /></div>