This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add cache for FID to Header mappings
AbandonedPublic

Authored by kadircet on Mar 10 2021, 3:10 AM.

Details

Reviewers
sammccall
Summary

Depends on D98242

Diff Detail

Event Timeline

kadircet created this revision.Mar 10 2021, 3:10 AM
kadircet requested review of this revision.Mar 10 2021, 3:10 AM

Some performance measurements...
(workload is PreambleCallback for clangd/XRefs.cpp in sync mode with a fixed baseline of 99b01cf28db9db1a3ec0e25367bd325b7aca6d43, opt build without asserts)

baseline: 1.21s
baseline+D98242: 1.25s
baseline+D98242+D98329: 1.21s
baseline+D98371: 1.02s

So this patch does indeed help, and cancels out the extra work done in D98242 with this workload at least.
Nevertheless I think the speedups from D98371 clearly justify the more invasive approach to caching, so we should do something like that instead. (We don't need both as it caches at a slightly higher level).

clang-tools-extra/clangd/index/SymbolCollector.cpp
792

this is correct but subtle: if we get to here we know the symbol does not have any special handling so it's safe to cache with the file Id alone

kadircet abandoned this revision.Mar 11 2021, 3:50 AM

abandoning in favor of D98371