<p></p>
<blockquote>
<p dir="auto">Yes, the generated code is humongous. I guess it is price for implementing full Kotlin grammar. I have tried to check the library size with make && strip --strip-unneeded. Current master is about 3.57 MB, this branch yields 3.72 MB, so roughly 150kB. I agree it is quite a lot, but still manageable I hope.</p>
</blockquote>
<p dir="auto">It's not that bad, I guess I'm still stuck with the "it must fit a floppy" mentality.</p>

<table role="table">
<thead>
<tr>
<th>Implementation</th>
<th>Time</th>
<th>Avg. per file</th>
<th>Tags added</th>
</tr>
</thead>
<tbody>
<tr>
<td>C</td>
<td>4 s</td>
<td>66 us</td>
<td>567695</td>
</tr>
<tr>
<td>RegExp</td>
<td>155 s</td>
<td>2.5 ms</td>
<td>527908</td>
</tr>
<tr>
<td>Peg</td>
<td>523s</td>
<td>8.6 ms</td>
<td>782500</td>
</tr>
</tbody>
</table>
<br>
<p dir="auto">This is quite surprising, I would have expected the performance to be somewhere between a hand-written parser and a regex parser but it probably depends on the grammar and the lookahead it has to perform. Have you tried profiling the parser to see if there's not some unexpected bottleneck? With hand-written parsers I used the following:</p>
<p dir="auto"><a href="https://wiki.geany.org/howtos/profiling/gperftools" rel="nofollow">https://wiki.geany.org/howtos/profiling/gperftools</a></p>
<blockquote>
<p dir="auto">Unless the parser can recover from an error it is going to lose all or many symbols in more cases if it parses things that are not essential to detecting the tags since it will then find more errors. It is a problem with many languages, not just kotlin (see for example <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1019718027" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/2916" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/2916/hovercard" href="https://github.com/geany/geany/issues/2916">#2916</a>), but the fact many tag parsers skip lots of code reduces the impact of partly edited code (outside of declarations).</p>
</blockquote>
<p dir="auto">To be fair, hand-written ctags parsers aren't that great at error recovery either - when you type an extra <code>{</code> at the beginning of a file, it won't get parsed.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3034#issuecomment-988033555">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ4UCCD4E4SGAXSUA7DUPYR53ANCNFSM5I7MRDJA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJ3OGH4I32QRFBR7GWLUPYR53A5CNFSM5I7MRDJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHLSDEEY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3034#issuecomment-988033555",
"url": "https://github.com/geany/geany/pull/3034#issuecomment-988033555",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>