<p>Alright, just tried with the profiler and the big part of the problem should be solved by the patch here:</p>

<p><a href="https://github.com/techee/geany/commit/a11f82b7bca2697b41cbf01cf3151aad608f4e63" class="commit-link">techee@<tt>a11f82b</tt></a></p>

<p>It doesn't fix the slowness completely but at least it should fix the non-linear part of it. With about 4000 lines from your example about 75% of time was spent by rehighlighting the document. The remaining 25% were spent by the parser (I'm afraid we cannot do much with this).</p>

<p>If you are able to recompile, could you try the patch if it helps?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/issues/791#issuecomment-163970875">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJzl7DtWmtuXXybz-i2O1L2RA59s-ks5pOuiNgaJpZM4GwP8W.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/791#issuecomment-163970875"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>