[all-commits] [llvm/llvm-project] 773ad5: [index] Fix performance regression with indexing m...

Ben Langmuir via All-commits all-commits at lists.llvm.org
Wed Jun 16 10:16:51 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 773ad55a393f368cc92b1611c52e493ed45a353f
      https://github.com/llvm/llvm-project/commit/773ad55a393f368cc92b1611c52e493ed45a353f
  Author: Ben Langmuir <blangmuir at apple.com>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M clang/lib/Index/FileIndexRecord.cpp
    M clang/lib/Index/FileIndexRecord.h

  Log Message:
  -----------
  [index] Fix performance regression with indexing macros

When using FileIndexRecord with macros, symbol references can be seen
out of source order, which was causing a regression to insert the
symbols into a vector. Instead, we now lazily sort the vector. The
impact is small on most code, but in very large files with many macro
references (M) near the beginning of the file followed by many decl
references (D) it was O(M*D). A particularly bad protobuf-generated
header was observed with a 100% regression in practice.

rdar://78628133




More information about the All-commits mailing list