[Github-comments] [geany/geany] Add support for Kotlin tags (PR #3034)

Jiří Techet notifications at xxxxx
Tue Dec 7 15:29:33 UTC 2021


> 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.

It's not that bad, I guess I'm still stuck with the "it must fit a floppy" mentality.

<!DOCTYPE html>

Implementation | Time | Avg. per file | Tags added
-- | -- | -- | --
C | 4 s | 66 us | 567695
RegExp | 155 s | 2.5 ms | 527908
Peg | 523s | 8.6 ms | 782500

<br class="Apple-interchange-newline">

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:

https://wiki.geany.org/howtos/profiling/gperftools

> 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 #2916), but the fact many tag parsers skip lots of code reduces the impact of partly edited code (outside of declarations).

To be fair, hand-written ctags parsers aren't that great at error recovery either - when you type an extra `{` at the beginning of a file, it won't get parsed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3034#issuecomment-988033555
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211207/4c57ac6e/attachment.htm>


More information about the Github-comments mailing list