|
|
Home » Developing U++ » U++ Developers corner » clangd
|
Re: clangd [message #57522 is a reply to message #57515] |
Thu, 16 September 2021 18:42   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
When I open a project and Core was changed, it takes ~70 sec. to reindex a project (~16 min. of total CPU time).
When there is nothing to reindex, then opening (checking and loading of indexes) a project takes ~10 sec.
Regards,
Novo
[Updated on: Thu, 16 September 2021 19:04] Report message to a moderator
|
|
|
Re: clangd [message #57523 is a reply to message #57522] |
Thu, 16 September 2021 19:02   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
Links:
ccls - C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited.
NeoVim.
NeoVim plugins:
Navigator - Navigate codes like a breeze. Exploring LSP and Tree-sitter symbols a piece of cake.
completion-nvim - A async completion framework aims to provide completion to neovim's built in LSP written in Lua.
Regards,
Novo
|
|
|
|
|
Re: clangd [message #57526 is a reply to message #57525] |
Fri, 17 September 2021 00:19   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
I checked performance on a non-gui app.
Completely reindex: 5 min. of total CPU time.
Load an already indexed project: 1:30 min. of total CPU time.
This is acceptable on a 8-core (16 threads) cpu.
Basically, this is speed of compilation.
Regards,
Novo
|
|
|
Re: clangd [message #57527 is a reply to message #57526] |
Fri, 17 September 2021 00:20   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
Well, this non-gui app uses a lot of complicated templates.
So, compilation speed can be slow.
Regards,
Novo
|
|
|
Re: clangd [message #57528 is a reply to message #57527] |
Fri, 17 September 2021 00:25   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
The project itself opens up immediately. Language Server loads info in background asynchronously.
Navigation is disabled till LS finishes its job.
Regards,
Novo
|
|
|
Re: clangd [message #57535 is a reply to message #57528] |
Fri, 17 September 2021 16:15   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
You can check performance by yourself.
clangd:
--compile-commands-dir=<string> - Specify a path to look for compile_commands.json. If path is invalid, clangd will look in the current directory and parent paths of each source file
ccls:
--index=<root> - standalone mode: index a project and exit
Do not forget to run "umk -j" to create a compile_commands.json file.
Regards,
Novo
|
|
|
|
Re: clangd [message #57537 is a reply to message #57536] |
Fri, 17 September 2021 21:09   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Fri, 17 September 2021 12:49
Could you do that for theide?
I do not really understand what you mean by that.
Quote:
BTW, that could mean that BLITZ could still work in that context, right?
Mirek
Correct. Everything that can be compiled with Clang can work in this context.
Just instead of real compilation you need to log Clang commands into a compile_commands.json file.
Current implementation of a "-j" option is not using BLITZ. Most likely, I did that because I couldn't figure out how to do that in umk, and after initial version begun to work I switched to another "let's make it work" project.
Regards,
Novo
|
|
|
|
Re: clangd [message #57539 is a reply to message #57538] |
Fri, 17 September 2021 23:55   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Fri, 17 September 2021 16:52Novo wrote on Fri, 17 September 2021 21:09mirek wrote on Fri, 17 September 2021 12:49
Could you do that for theide?
I do not really understand what you mean by that.
Can you test how long it takes to process theide project (complete, like after Core change)?
Mirek
I'll try. Time should be similar to compilation in Debug configuration (optimization is disabled).
Regards,
Novo
|
|
|
|
|
|
Re: clangd [message #57543 is a reply to message #57541] |
Sat, 18 September 2021 00:43   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
Clang-based indexers are good when you do not have anything else, but they are very slow and memory-hungry.
Theoretically, they should have an ideal quality, but I often have problems with them, starting with inability to compile code from time to time (actually, quite often).
In case, when Clang fails, I just use regular search in project's folders.
But when it works, it is pretty good
A trick is not to save a file very often to prevent reindexing ...
Regards,
Novo
|
|
|
Re: clangd [message #57544 is a reply to message #57542] |
Sat, 18 September 2021 13:46   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Fri, 17 September 2021 18:31
Needs BLITZ...
A catch: you have to add all used h-files to compile_commands.json explicitly.
Regards,
Novo
|
|
|
|
|
Goto Forum:
Current Time: Wed Apr 30 07:57:56 CEST 2025
Total time taken to generate the page: 0.06823 seconds
|
|
|