[all-commits] [llvm/llvm-project] af3e88: Speed up compilation of ASTImporter

Reid Kleckner via All-commits all-commits at lists.llvm.org
Thu Jan 30 11:01:29 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: af3e88495627c9b150814ff13e5749e1ed31c5d3
      https://github.com/llvm/llvm-project/commit/af3e88495627c9b150814ff13e5749e1ed31c5d3
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-01-30 (Thu, 30 Jan 2020)

  Changed paths:
    M clang/lib/AST/ASTImporter.cpp

  Log Message:
  -----------
  Speed up compilation of ASTImporter

Avoid recursively instantiating importSeq. Use initializer list
expansion to stamp out a single instantiation of std::tuple of the
deduced sequence of types, and thread the error around that tuple type.
Avoids needlessly instantiating std::tuple N-1 times.

new time to compile: 0m25.985s
old time to compile: 0m35.563s

new obj size: 10,000kb
old obj size: 12,332kb

I found the slow TU by looking at ClangBuildAnalyzer results, and looked
at -ftime-trace for the file in chrome://tracing to find this.

Tested with: clang-cl, MSVC, and GCC.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D73667




More information about the All-commits mailing list