I've drafted the code for parsing each file separately in idle handler (#1291), to avoid blocking the UI for too long.

I've just tried that but it parses all files at once right? And adding all files to TM is actually a feature. In the past files could only be added one by one but there was a huge performance problems of that - after each added file the tag list was sorted and this sorting happened after adding each file on a growing list of tags. For big projects the time spent on sorting was much bigger than the parsing itself. Now, when you add all the files at once, Geany just performs one sort at the end and e.g. for all linux kernel sources it takes something like 3s out of total 30s spent on parsing.

As you mentioned, it looks quite weird now with the cursor and editor "ready" but impossible to type anything. I think I prefer the previous behavior.

It would actually be great if something like this could be used in Geany itself as well - only the current document needs to be fully parsed when opened, other files might be parsed "in background" to improve start-up / project open times. Too bad that cooperative multitasking/threading is so complicated in C.

I think ctags isn't re-entrant so it would be hard to do. The big advantage of the single-threaded approach is the simplicity of the implementation and simplicity to reproduce bugs.

BTW, it is funny, that very similar thing (that asynchronous parsing would speed things up), was geany/geany#3571 (comment) in the LSP pull request just today 🙂

It's true parallel execution in a separate process though. I was actually thinking about one thing - it would be possible to create a ctags-backed LSP server living in a separate process doing something similar to what tag manager does in Geany. But I'm not sure if I'm sufficiently motivated to do something like that myself :-).


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany-plugins/issues/1289/1793537378@github.com>