[PATCH] D50331: [clangd] *Prototype* Drop dynamic index symbols from files that are already indexed in static index.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 6 06:11:00 PDT 2018


ioeric created this revision.
ioeric added reviewers: ilya-biryukov, hokein.
Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay.

Currently, dynamic index collects symbols for the entire TU for each open/active
file. When static index is enabled, this can be wasteful as (intuitively) most files in a
TU should remain the same. Duplicate symbols in both dynamic index and static index can
lead to unncessary memory usage and merging duplcated symbols can contribute to latency.

To avoid indexing the same files in both dynamic index and static index, we also collect
hash values/digests for all headers in the TU during indexing time and expose an interface
from the index to get digests for files. Dynamic/file index can simply drop symbols from
files whose digests are the same as those in static index.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50331

Files:
  clangd/ClangdServer.cpp
  clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp
  clangd/index/FileIndex.cpp
  clangd/index/FileIndex.h
  clangd/index/Index.cpp
  clangd/index/Index.h
  clangd/index/MemIndex.cpp
  clangd/index/MemIndex.h
  clangd/index/Merge.cpp
  clangd/index/SymbolCollector.cpp
  clangd/index/SymbolCollector.h
  clangd/index/SymbolYAML.cpp
  clangd/tool/ClangdMain.cpp
  unittests/clangd/CodeCompleteTests.cpp
  unittests/clangd/FileIndexTests.cpp
  unittests/clangd/IndexTests.cpp
  unittests/clangd/SymbolCollectorTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50331.159286.patch
Type: text/x-patch
Size: 35910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180806/2ae1dfb2/attachment-0001.bin>


More information about the cfe-commits mailing list