[clang-tools-extra] Symbol tags in SymbolInformation, WorkspaceSymbol, CallHierarchyItem and TypeHierarchyItem (PR #170103)

Dimitri Ratz via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 09:46:21 PDT 2026


ratzdi wrote:

> I haven't had a chance to look at this in any amount of detail yet, but just a high-level comment for now:
> 
> By adding a new field to `Symbol`, we are increasing the size of the index in memory and on disk. It would be helpful to understand the magnitude of this increase, by measuring the size of the index for a sizeable codebase (llvm-project is suitable, or another C++ project you work on if it's comparable in size to llvm-project or larger) before and after this patch.
> 
> The size of the index on disk can be measured by checking the size of the `<project>/.cache/clangd/index` directory after background indexing has completed.
> 
> The size of the index in memory can be measured by invoking the "clangd: Show memory usage" command in vscode, and looking at the `background_index` entry in the opened "Clangd memory usage" tree view.



preliminary results:
 clangd version > | 18.01.3 | this branch | main @07ff1a63
-- | -- | -- | --
background index | ~1400 MB | ~2972 MB | ~2903 MB
index cache disk usage | ~159 MB | ~188 MB | ~187 MB

This and the main branch are of build type release,  clangd 18.1.3 is the official Debian package for Ubuntu.  
Generally, a larger statistical base is better than just a single run. However, this takes significantly more time. Therefore, these results are not sufficiently robust for me, but they also show that the memory usage is not excessive.



Performance results based on my own tiny test framework: 

https://github.com/aboutthinkdigital/llvm-project/commit/122929a2bb052b3472225fad3cb4ccf6a7d4ac65#diff-682cd93d987696d63772dacf5e713314e04b47cc67d21d4d46900ae143fa6aae

https://github.com/aboutthinkdigital/llvm-project/commit/122929a2bb052b3472225fad3cb4ccf6a7d4ac65#diff-c150b9b8ec207dc46132088b0e4bed61bedcc6e7d71b88b1c8038a88e83f9968

Each file is a test run result from the main branch and this branch. I can go into detail about the tests if needed. What the tests show is that the index files in this branch are approximately 3% larger than those in the main branch.

https://github.com/llvm/llvm-project/pull/170103


More information about the cfe-commits mailing list