<table><tr><td style="">sirgienko created this revision.<br />sirgienko added reviewers: Cantor, asemke.<br />sirgienko added a project: Cantor.<br />Restricted Application added a subscriber: KDE Edu.<br />Restricted Application added a project: KDE Edu.<br />sirgienko requested review of this revision.
</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/D11992">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Now, in <tt style="background: #ebebeb; font-size: 13px;">addRules</tt> we call <tt style="background: #ebebeb; font-size: 13px;">addRule</tt>, which emit <tt style="background: #ebebeb; font-size: 13px;">rulesChanged</tt>, that leads to <tt style="background: #ebebeb; font-size: 13px;">rehighlight</tt> all worksheet. This is useless work, because for each rule in rules container we reprocessing all worksheet. (instead better option to emit <tt style="background: #ebebeb; font-size: 13px;">rulesChanged</tt> only one time after container processing). So, when container is big, performance falls quite strongly, for example highlighter of octave backend spends 2-4 seconds for adding new function. So this changes improve <tt style="background: #ebebeb; font-size: 13px;">emit</tt> logic, calling only one event for rules container.</p></div></div><br /><div><strong>TEST PLAN</strong><div><ol class="remarkup-list">
<li class="remarkup-list-item">Start octave backend, write octave function, check, that cantor is freezed for few seconds</li>
<li class="remarkup-list-item">Apply patch</li>
<li class="remarkup-list-item">Check, that octave backend don't freeze after entry with user function.</li>
</ol></div></div><br /><div><strong>REPOSITORY</strong><div><div>R55 Cantor</div></div></div><br /><div><strong>BRANCH</strong><div><div>fix-highlighter-performance-problem</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11992">https://phabricator.kde.org/D11992</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/lib/defaulthighlighter.cpp<br />
src/lib/defaulthighlighter.h</div></div></div><br /><div><strong>To: </strong>sirgienko, Cantor, asemke<br /><strong>Cc: </strong>Cantor, KDE Edu, narvaez, apol<br /></div>