ccls icon indicating copy to clipboard operation
ccls copied to clipboard

unnecessary re-indexing when trackDepenency is 2

Open JohnC32 opened this issue 3 years ago • 0 comments

We have a large code base and it takes hours to index. Therefore, we index the code base using ccls in cron at night. We are using the btrfs file system which means we can create instant snapshots (clones). So our workflow is

  1. cron at night: run ccls into a "latest" area and store the index within the "lastest" directory
  2. workday: clone the latest area into a "working" area, which means we copied the pre-generated index
  3. Using emacs as a front end, we work in our "working" area. We start LSP / CCLS using the pathMappings option to reuse the copied pre-generated index

We've noticed that if trackDependency is 0 we see in the Emacs *ccls::stderr* thousands of "I load cache for" messages and ccls starts up quickly in a few minutes.

However, if we set trackDependency is 2, we see in the Emacs *ccls::stderr* thousands of "I load cache for" and "I store index for" messages. In this case ccls starts up slowly taking hours. I assume the "I store index for" messages are CCLS re-indexing the file that is already index.

Why does changing the value of trackDependency not reuse the already computed index?

You should be able to reproduce this by

  1. pre-indexing say ccls itself in a "latest" directory
  2. cloning or cp -r the "latest" directory to a "working" directory
  3. Use emacs or other editor to start ccls with the different values of trackDependency and the necessary pathMappings.

System information

  • ccls version (git describe --tags --long): CCLS from Dec 2, 2022, ec101b92983066b652921ab0702e1b76619aa201
  • clang version: 15.0.0
  • OS: Debian 11
  • Editor: Emacs 27
  • Language client (and version): Nov-30-2022 version, 2dd33404eb8f7133683b94e18c937de4707d4c33

JohnC32 avatar Feb 01 '23 15:02 JohnC32