[Modules] Add stats to measure performance of building and loading modules.
authorVolodymyr Sapsai <vsapsai@apple.com>
Mon, 6 Jan 2020 19:55:55 +0000 (11:55 -0800)
committerVolodymyr Sapsai <vsapsai@apple.com>
Thu, 24 Sep 2020 19:23:47 +0000 (12:23 -0700)
commitc4bacc3c9b333bb7032fb96f41d6f5b851623132
tree930697e71c68ad1a9fe48d9f023af6c4dd4c7854
parente75afc9acf9b6de511c0c90b8e8a06364de46e3e
[Modules] Add stats to measure performance of building and loading modules.

Measure amount of high-level or fixed-cost operations performed during
building/loading modules and during header search. High-level operations
like building a module or processing a .pcm file are motivated by
previous issues where clang was re-building modules or re-reading .pcm
files unnecessarily. Fixed-cost operations like `stat` calls are tracked
because clang cannot change how long each operation takes but it can
perform fewer of such operations to improve the compile time.

Also tracking such stats over time can help us detect compile-time
regressions. Added stats are more stable than the actual measured
compilation time, so expect the detected regressions to be less noisy.

rdar://problem/55715134

Reviewed By: aprantl, bruno

Differential Revision: https://reviews.llvm.org/D86895
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Serialization/ASTReader.cpp
llvm/lib/Support/MemoryBuffer.cpp
llvm/lib/Support/Path.cpp
llvm/lib/Support/Unix/Path.inc
llvm/lib/Support/Windows/Path.inc