[PATCH] D80296: [clangd] Don't traverse the AST within uninteresting files during indexing

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 20 07:35:04 PDT 2020


sammccall created this revision.
sammccall added a reviewer: kadircet.
Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

We already skip function bodies from these files while parsing, and drop symbols
found in them. However, traversing their ASTs still takes a substantial amount
of time.

Non-scientific benchmark on my machine:

  background-indexing llvm-project (llvm+clang+clang-tools-extra), wall time
  before: 7:46
  after: 5:13
  change: -33%

Indexer.cpp libclang should be updated too, I'm less familiar with that code,
and it's doing tricky things with the ShouldSkipFunctionBody callback, so it
needs to be done separately.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80296

Files:
  clang-tools-extra/clangd/index/IndexAction.cpp
  clang-tools-extra/clangd/unittests/IndexActionTests.cpp
  clang/include/clang/Index/IndexingAction.h
  clang/include/clang/Index/IndexingOptions.h
  clang/lib/Index/IndexDecl.cpp
  clang/lib/Index/IndexingAction.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80296.265232.patch
Type: text/x-patch
Size: 8539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200520/a8fca7bc/attachment.bin>


More information about the cfe-commits mailing list