irony-mode
irony-mode copied to clipboard
High completion latency when working with large codebase
I'm using irony-mode with a huge codebase (O(100k) header files) on a linux machine. Completion quality is quite good but the latency for suggesting completion is 4-5 seconds, which makes it difficult to use irony-mode with company-irony.
Is there any way to improve the completion performance? From my CPU usage, irony-mode seems to be using one thread for completion. Multithreading can be a good way to improve the performance. The code indexing can be done in the background thread and completion lookup can be done on request thread. Or simply the completion lookup can be parallelized.
irony-server uses libclang for completion. EIther I'm misusing the API or the operation is simply slow in libclang. Either way, if the solution is multithreading or any other smart indexing, it is out of the league for irony-server.
The next step in this direction would be clangd in my opinion: https://github.com/llvm-mirror/clang-tools-extra/tree/master/clangd
Which I'm not sure is easy to use with Emacs yet.
I guess the reason might be libclang outputs too many candidates. Is it possible to pass 'prefix' parameter to irony-server and filter the complete result in irony-server?
Is it possible to pass 'prefix' parameter to irony-server and filter the complete result in irony-server?
It is technically possible, and I had a refactoring "somewhat recently" to allow to add more commands. Prefix filtering (fuzzy or not) was one of the use case I had in mind. So the only thing required is to code it, which I don't plan to do anytime soon but would be happy to give guidance/review.
Hi Saracasm, I just created a pull request #412 to support the filtering. We still need to modify company-irony to support it. I will send other request if #412 is accepted.
Any suggestions?