This is an archive of the discontinued LLVM Phabricator instance.

[clangd] *Prototype* Drop dynamic index symbols from files that are already indexed in static index.
Changes PlannedPublic

Authored by ioeric on Aug 6 2018, 6:10 AM.

Details

Summary

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.

Event Timeline

ioeric created this revision.Aug 6 2018, 6:10 AM
ioeric added a comment.Aug 6 2018, 6:14 AM

Code is not polished. I'd like to get some high-level feedback before proceeding further and splitting this into smaller patches.

ioeric planned changes to this revision.Aug 7 2018, 8:24 AM