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

Jan Dolinár notifications at xxxxx
Tue Dec 7 18:40:42 UTC 2021


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

I did a lot of profiling on PackCC and it turns out it is not very efficient with memory allocations (see https://github.com/universal-ctags/ctags/pull/2866#issuecomment-780332841), the backtracking is constantly allocating and deallocating small chunks of memory. So, more rules leads to more backtracking, which leads to more allocations, which slows it down. I have even [proposed couple possible optimizations](https://github.com/arithy/packcc/pull/48), but I did not have from enough manpower to actually implement it (sadly, I am not very proficient in C).

I might look into the grammar optimization in future, so the parser might become somewhat faster (especially, if it slows Geany down, that would annoy me a lot). Probably could beat the RegExp based ones (for comparable grammars). According to creator of ctags, the peg parser is about 15-30 times slower than handwritten parser (citation from https://github.com/universal-ctags/ctags/pull/2866#issuecomment-778786809). Even with grammar optimizations, it would still probably be about an order of magnitude slower than let's say current C parser.

-- 
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-988176361
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211207/e5d4cd29/attachment-0001.htm>


More information about the Github-comments mailing list