My Objc/C++ project compilation time is too long. Even when Xcode is doing an incremental build, it can take e.g. 140s = 2.5 minutes.
The problem is, 2.5 minutes for an incremental build says me nothing of what can be improved.
E.g. Xcode Report Navigator shows that some file is compiled in 4.2s:
How can I check if this file could be compiled in 2.1s? 0.3s? What are the constraints except of the number of symbols in a resulting binary?
I've heard a one should use modules to speedup incremental builds, but let's assume I'm trying to speedup compile time for already extracted module.
I've heard that there's some kind of the "symbol dependency graph", but haven't found any practical advice how to use it for troubleshooting compile-time issues.
I've tried such tools to uncover "symbol dependencies", but they seem too high-level (and the first one generated too big file to be opened with graphviz on MacOS):
Also I've seen such build flags for Swift: -warn-long-function-bodies=200 / -warn-long-expression-type-checking=200.
These flags can mark long functions, but could they explain WHY those function are so long?
E.g. maybe some for loop was written poorly, and a compiler has to optimize it for a faster execution. In such case, if a programmer wrote that loop in a more optimal way, a compiler wouldn't have to optimize it, and a programmer wouldn't wait for 1-2 seconds at each build.
So, let's say there's an Objc/C++ file which is compiled in N seconds. The questions are:
- How to see the "divided" time for this file? E.g.
preprocessing a whole file: N/4 seconds,compile func1: N/4 seconds,compile func2: N/4 seconds,optimize an assembly: N/4 seconds. - Are there
clangutils for such thing? - How to check if there's an unnesessary
#include/#importwhich is slowing down compilation. - Can a compilation time correlate to a number of warnings which Xcode has to print? (I know I can check it by eliminating the warnings, but there're C++ files with almost no warnings and even bigger compilation time).
I know it's a wide topic, so any links/advices are highly appreciated.

