-ftime-report/-ftime-report-details(gcc/clang)

gcc/clang都支持-ftime-report,可以打印编译过程每个阶段的时间摘要信息。

// demo.cc
#include <vector>
#include <string>
#include <unordered_map>
#include <regex>
int main()
{
    std::vector<int> v(10);
    v.push_back(7);
    std::unordered_map<std::string, double> m;
    m.insert(std::make_pair("foo", 1.0));
    std::regex re("^asd.*$");
    return 0;
}

1 gcc -ftime-trace

~/project/compile-time-analysis$ g++ -ftime-report -o demo demo.cc
Time variable                                   usr           sys          wall               GGC
 phase setup                        :   0.02 (  0%)   0.01 (  0%)   0.03 (  0%)    1471 kB (  1%)
 phase parsing                      :   2.44 ( 41%)   1.25 ( 53%)   3.72 ( 44%)   81297 kB ( 39%)
 phase lang. deferred               :   1.12 ( 19%)   0.35 ( 15%)   1.47 ( 18%)   39059 kB ( 19%)
 phase opt and generate             :   2.40 ( 40%)   0.74 ( 31%)   3.14 ( 38%)   88983 kB ( 42%)
 phase finalize                     :   0.00 (  0%)   0.00 (  0%)   0.01 (  0%)       0 kB (  0%)
 |name lookup                       :   0.56 (  9%)   0.27 ( 11%)   0.88 ( 11%)    4616 kB (  2%)
 |overload resolution               :   0.75 ( 13%)   0.15 (  6%)   0.83 ( 10%)   19835 kB (  9%)
 dump files                         :   0.19 (  3%)   0.09 (  4%)   0.45 (  5%)       0 kB (  0%)
 callgraph construction             :   0.16 (  3%)   0.06 (  3%)   0.14 (  2%)    1901 kB (  1%)
 callgraph optimization             :   0.04 (  1%)   0.03 (  1%)   0.10 (  1%)       0 kB (  0%)
 ipa dead code removal              :   0.01 (  0%)   0.00 (  0%)   0.01 (  0%)       0 kB (  0%)
 ipa inlining heuristics            :   0.00 (  0%)   0.00 (  0%)   0.02 (  0%)       0 kB (  0%)
 ipa free inline summary            :   0.01 (  0%)   0.00 (  0%)   0.00 (  0%)       0 kB (  0%)
 cfg construction                   :   0.01 (  0%)   0.00 (  0%)   0.01 (  0%)     418 kB (  0%)
 cfg cleanup                        :   0.05 (  1%)   0.02 (  1%)   0.07 (  1%)      11 kB (  0%)
 trivially dead code                :   0.01 (  0%)   0.03 (  1%)   0.02 (  0%)       0 kB (  0%)
 df scan insns                      :   0.06 (  1%)   0.00 (  0%)   0.03 (  0%)      81 kB (  0%)
 df live regs                       :   0.04 (  1%)   0.01 (  0%)   0.05 (  1%)       0 kB (  0%)
 df reg dead/unused notes           :   0.02 (  0%)   0.00 (  0%)   0.02 (  0%)     760 kB (  0%)
 register information               :   0.02 (  0%)   0.00 (  0%)   0.01 (  0%)       0 kB (  0%)
 alias analysis                     :   0.00 (  0%)   0.00 (  0%)   0.02 (  0%)     259 kB (  0%)
 rebuild jump labels                :   0.01 (  0%)   0.00 (  0%)   0.03 (  0%)       0 kB (  0%)
 preprocessing                      :   0.34 (  6%)   0.30 ( 13%)   0.70 (  8%)    1705 kB (  1%)
 parser (global)                    :   0.52 (  9%)   0.35 ( 15%)   0.82 ( 10%)   26102 kB ( 12%)
 parser struct body                 :   0.39 (  7%)   0.14 (  6%)   0.51 (  6%)   14552 kB (  7%)
 parser enumerator list             :   0.01 (  0%)   0.00 (  0%)   0.01 (  0%)     111 kB (  0%)
 parser function body               :   0.29 (  5%)   0.08 (  3%)   0.30 (  4%)    6958 kB (  3%)
 parser inl. func. body             :   0.09 (  2%)   0.02 (  1%)   0.15 (  2%)    1804 kB (  1%)
 parser inl. meth. body             :   0.26 (  4%)   0.10 (  4%)   0.46 (  5%)    8326 kB (  4%)
 template instantiation             :   1.59 ( 27%)   0.57 ( 24%)   2.16 ( 26%)   60627 kB ( 29%)
 constant expression evaluation     :   0.05 (  1%)   0.02 (  1%)   0.06 (  1%)     162 kB (  0%)
 early inlining heuristics          :   0.00 (  0%)   0.00 (  0%)   0.01 (  0%)       0 kB (  0%)
 inline parameters                  :   0.02 (  0%)   0.03 (  1%)   0.01 (  0%)    1621 kB (  1%)
 tree gimplify                      :   0.03 (  1%)   0.01 (  0%)   0.09 (  1%)    6690 kB (  3%)
 tree eh                            :   0.02 (  0%)   0.01 (  0%)   0.02 (  0%)    1272 kB (  1%)
 tree CFG construction              :   0.01 (  0%)   0.01 (  0%)   0.01 (  0%)    2817 kB (  1%)
 tree CFG cleanup                   :   0.07 (  1%)   0.01 (  0%)   0.03 (  0%)       4 kB (  0%)
 tree PHI insertion                 :   0.00 (  0%)   0.00 (  0%)   0.03 (  0%)     307 kB (  0%)
 tree SSA rewrite                   :   0.00 (  0%)   0.00 (  0%)   0.03 (  0%)    1172 kB (  1%)
 tree SSA other                     :   0.05 (  1%)   0.01 (  0%)   0.02 (  0%)     246 kB (  0%)
 tree SSA incremental               :   0.00 (  0%)   0.00 (  0%)   0.01 (  0%)       0 kB (  0%)
 tree operand scan                  :   0.04 (  1%)   0.02 (  1%)   0.02 (  0%)    2989 kB (  1%)
 tree switch lowering               :   0.00 (  0%)   0.02 (  1%)   0.00 (  0%)      46 kB (  0%)
 dominance computation              :   0.05 (  1%)   0.01 (  0%)   0.08 (  1%)       0 kB (  0%)
 out of ssa                         :   0.03 (  1%)   0.00 (  0%)   0.04 (  0%)     202 kB (  0%)
 expand vars                        :   0.01 (  0%)   0.00 (  0%)   0.03 (  0%)     624 kB (  0%)
 expand                             :   0.13 (  2%)   0.05 (  2%)   0.18 (  2%)    9360 kB (  4%)
 post expand cleanups               :   0.04 (  1%)   0.00 (  0%)   0.02 (  0%)    1550 kB (  1%)
 varconst                           :   0.00 (  0%)   0.01 (  0%)   0.00 (  0%)       5 kB (  0%)
 jump                               :   0.01 (  0%)   0.01 (  0%)   0.01 (  0%)       0 kB (  0%)
 loop init                          :   0.02 (  0%)   0.01 (  0%)   0.06 (  1%)    1346 kB (  1%)
 loop fini                          :   0.01 (  0%)   0.01 (  0%)   0.02 (  0%)       0 kB (  0%)
 mode switching                     :   0.00 (  0%)   0.00 (  0%)   0.01 (  0%)       0 kB (  0%)
 integrated RA                      :   0.37 (  6%)   0.07 (  3%)   0.28 (  3%)   42996 kB ( 20%)
 LRA non-specific                   :   0.14 (  2%)   0.03 (  1%)   0.14 (  2%)     334 kB (  0%)
 LRA virtuals elimination           :   0.01 (  0%)   0.01 (  0%)   0.03 (  0%)     813 kB (  0%)
 LRA reload inheritance             :   0.01 (  0%)   0.00 (  0%)   0.04 (  0%)       0 kB (  0%)
 LRA create live ranges             :   0.02 (  0%)   0.00 (  0%)   0.03 (  0%)      82 kB (  0%)
 LRA hard reg assignment            :   0.00 (  0%)   0.00 (  0%)   0.02 (  0%)       0 kB (  0%)
 reload                             :   0.04 (  1%)   0.01 (  0%)   0.02 (  0%)       0 kB (  0%)
 thread pro- & epilogue             :   0.11 (  2%)   0.02 (  1%)   0.14 (  2%)    2921 kB (  1%)
 machine dep reorg                  :   0.00 (  0%)   0.00 (  0%)   0.01 (  0%)     199 kB (  0%)
 shorten branches                   :   0.06 (  1%)   0.00 (  0%)   0.04 (  0%)       0 kB (  0%)
 reg stack                          :   0.00 (  0%)   0.01 (  0%)   0.00 (  0%)       0 kB (  0%)
 final                              :   0.11 (  2%)   0.07 (  3%)   0.25 (  3%)    3562 kB (  2%)
 symout                             :   0.03 (  1%)   0.01 (  0%)   0.02 (  0%)       0 kB (  0%)
 initialize rtl                     :   0.01 (  0%)   0.00 (  0%)   0.02 (  0%)      12 kB (  0%)
 rest of compilation                :   0.34 (  6%)   0.07 (  3%)   0.39 (  5%)    4362 kB (  2%)
 unaccounted post reload            :   0.00 (  0%)   0.00 (  0%)   0.01 (  0%)       0 kB (  0%)
 repair loop structures             :   0.00 (  0%)   0.00 (  0%)   0.01 (  0%)       0 kB (  0%)
 TOTAL                              :   5.98          2.35          8.37         210822 kB

2 clang -ftime-report

~/project/compile-time-analysis$ clang++ -ftime-report -o demo demo.cc 
===-------------------------------------------------------------------------===
                         Miscellaneous Ungrouped Timers
===-------------------------------------------------------------------------===

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   1.1303 ( 78.4%)   0.4898 ( 96.2%)   1.6201 ( 83.1%)   1.6424 ( 83.0%)  Code Generation Time
   0.3110 ( 21.6%)   0.0196 (  3.8%)   0.3306 ( 16.9%)   0.3353 ( 17.0%)  LLVM IR Generation Time
   1.4413 (100.0%)   0.5094 (100.0%)   1.9507 (100.0%)   1.9776 (100.0%)  Total

===-------------------------------------------------------------------------===
                      Instruction Selection and Scheduling
===-------------------------------------------------------------------------===
  Total Execution Time: 0.1089 seconds (0.1088 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   0.0186 ( 23.0%)   0.0063 ( 22.4%)   0.0249 ( 22.8%)   0.0255 ( 23.4%)  DAG Combining 1
   0.0146 ( 18.1%)   0.0049 ( 17.4%)   0.0195 ( 17.9%)   0.0194 ( 17.9%)  Instruction Selection
   0.0141 ( 17.4%)   0.0050 ( 17.8%)   0.0190 ( 17.5%)   0.0188 ( 17.3%)  Instruction Scheduling
   0.0108 ( 13.4%)   0.0036 ( 13.0%)   0.0145 ( 13.3%)   0.0143 ( 13.1%)  Instruction Creation
   0.0106 ( 13.1%)   0.0035 ( 12.6%)   0.0141 ( 12.9%)   0.0139 ( 12.7%)  DAG Combining 2
   0.0045 (  5.5%)   0.0018 (  6.6%)   0.0063 (  5.8%)   0.0063 (  5.8%)  DAG Legalization
   0.0035 (  4.4%)   0.0013 (  4.6%)   0.0048 (  4.4%)   0.0048 (  4.4%)  Type Legalization
   0.0025 (  3.1%)   0.0009 (  3.3%)   0.0034 (  3.2%)   0.0034 (  3.1%)  Instruction Scheduling Cleanup
   0.0016 (  2.0%)   0.0006 (  2.2%)   0.0022 (  2.0%)   0.0023 (  2.1%)  Vector Legalization
   0.0000 (  0.1%)   0.0000 (  0.1%)   0.0001 (  0.1%)   0.0001 (  0.1%)  DAG Combining after legalize types
   0.0809 (100.0%)   0.0280 (100.0%)   0.1089 (100.0%)   0.1088 (100.0%)  Total

===-------------------------------------------------------------------------===
                                 DWARF Emission
===-------------------------------------------------------------------------===
  Total Execution Time: 0.0307 seconds (0.0321 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   0.0131 ( 61.5%)   0.0058 ( 62.1%)   0.0189 ( 61.7%)   0.0189 ( 58.7%)  DWARF Exception Writer
   0.0082 ( 38.4%)   0.0035 ( 37.9%)   0.0117 ( 38.2%)   0.0133 ( 41.2%)  Debug Info Emission
   0.0000 (  0.1%)   0.0000 (  0.0%)   0.0000 (  0.1%)   0.0000 (  0.1%)  DWARF Debug Writer
   0.0213 (100.0%)   0.0094 (100.0%)   0.0307 (100.0%)   0.0321 (100.0%)  Total

===-------------------------------------------------------------------------===
                      ... Pass execution timing report ...
===-------------------------------------------------------------------------===
  Total Execution Time: 0.9793 seconds (0.9842 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   0.2103 ( 30.5%)   0.0770 ( 26.6%)   0.2873 ( 29.3%)   0.2864 ( 29.1%)  X86 DAG->DAG Instruction Selection
   0.0954 ( 13.8%)   0.0388 ( 13.4%)   0.1342 ( 13.7%)   0.1345 ( 13.7%)  X86 Assembly Printer
   0.0273 (  4.0%)   0.0113 (  3.9%)   0.0386 (  3.9%)   0.0393 (  4.0%)  Prologue/Epilogue Insertion & Frame Finalization
   0.0231 (  3.3%)   0.0090 (  3.1%)   0.0320 (  3.3%)   0.0333 (  3.4%)  Fast Register Allocator
   0.0143 (  2.1%)   0.0052 (  1.8%)   0.0196 (  2.0%)   0.0196 (  2.0%)  Inliner for always_inline functions
   0.0128 (  1.9%)   0.0055 (  1.9%)   0.0183 (  1.9%)   0.0180 (  1.8%)  Two-Address instruction pass
   0.0146 (  2.1%)   0.0032 (  1.1%)   0.0178 (  1.8%)   0.0175 (  1.8%)  X86 FP Stackifier
   0.0112 (  1.6%)   0.0050 (  1.7%)   0.0163 (  1.7%)   0.0161 (  1.6%)  Insert stack protectors
   0.0104 (  1.5%)   0.0042 (  1.5%)   0.0147 (  1.5%)   0.0148 (  1.5%)  Dominator Tree Construction #2
   0.0100 (  1.4%)   0.0039 (  1.4%)   0.0139 (  1.4%)   0.0141 (  1.4%)  MachineDominator Tree Construction
   0.0072 (  1.0%)   0.0051 (  1.8%)   0.0123 (  1.3%)   0.0125 (  1.3%)  Expand Atomic instructions
   0.0084 (  1.2%)   0.0034 (  1.2%)   0.0118 (  1.2%)   0.0121 (  1.2%)  X86 EFLAGS copy lowering
   0.0081 (  1.2%)   0.0035 (  1.2%)   0.0116 (  1.2%)   0.0116 (  1.2%)  Free MachineFunction
   0.0063 (  0.9%)   0.0054 (  1.9%)   0.0117 (  1.2%)   0.0116 (  1.2%)  Basic Alias Analysis (stateless AA impl)
   0.0066 (  1.0%)   0.0048 (  1.7%)   0.0114 (  1.2%)   0.0115 (  1.2%)  Dominator Tree Construction
   0.0077 (  1.1%)   0.0034 (  1.2%)   0.0111 (  1.1%)   0.0111 (  1.1%)  Exception handling preparation
   0.0077 (  1.1%)   0.0033 (  1.1%)   0.0110 (  1.1%)   0.0110 (  1.1%)  Natural Loop Information
   0.0077 (  1.1%)   0.0033 (  1.1%)   0.0110 (  1.1%)   0.0109 (  1.1%)  Dominator Tree Construction #3
   0.0075 (  1.1%)   0.0034 (  1.2%)   0.0109 (  1.1%)   0.0107 (  1.1%)  Finalize ISel and expand pseudo-instructions
   0.0064 (  0.9%)   0.0047 (  1.6%)   0.0111 (  1.1%)   0.0103 (  1.1%)  Lower constant intrinsics
   0.0070 (  1.0%)   0.0029 (  1.0%)   0.0099 (  1.0%)   0.0101 (  1.0%)  Lazy Branch Probability Analysis
   0.0072 (  1.0%)   0.0029 (  1.0%)   0.0101 (  1.0%)   0.0100 (  1.0%)  Post-RA pseudo instruction expansion pass
   0.0057 (  0.8%)   0.0043 (  1.5%)   0.0100 (  1.0%)   0.0099 (  1.0%)  Scalarize Masked Memory Intrinsics
   0.0054 (  0.8%)   0.0042 (  1.4%)   0.0096 (  1.0%)   0.0097 (  1.0%)  Expand reduction intrinsics
   0.0066 (  1.0%)   0.0029 (  1.0%)   0.0096 (  1.0%)   0.0096 (  1.0%)  Check CFA info and insert CFI instructions if needed
   0.0058 (  0.8%)   0.0025 (  0.9%)   0.0083 (  0.8%)   0.0085 (  0.9%)  X86 Indirect Branch Tracking
   0.0046 (  0.7%)   0.0037 (  1.3%)   0.0083 (  0.8%)   0.0084 (  0.9%)  Expand indirectbr instructions
   0.0057 (  0.8%)   0.0024 (  0.8%)   0.0082 (  0.8%)   0.0084 (  0.9%)  Bundle Machine CFG Edges
   0.0061 (  0.9%)   0.0024 (  0.8%)   0.0085 (  0.9%)   0.0082 (  0.8%)  Eliminate PHI nodes for register allocation
   0.0056 (  0.8%)   0.0026 (  0.9%)   0.0081 (  0.8%)   0.0081 (  0.8%)  X86 pseudo instruction expansion pass
   0.0055 (  0.8%)   0.0023 (  0.8%)   0.0078 (  0.8%)   0.0080 (  0.8%)  Insert fentry calls
   0.0053 (  0.8%)   0.0023 (  0.8%)   0.0076 (  0.8%)   0.0078 (  0.8%)  Implement the 'patchable-function' attribute
   0.0047 (  0.7%)   0.0020 (  0.7%)   0.0068 (  0.7%)   0.0076 (  0.8%)  X86 Retpoline Thunks
   0.0044 (  0.6%)   0.0033 (  1.1%)   0.0077 (  0.8%)   0.0076 (  0.8%)  Remove unreachable blocks from the CFG
   0.0051 (  0.7%)   0.0021 (  0.7%)   0.0073 (  0.7%)   0.0075 (  0.8%)  Machine Optimization Remark Emitter
   0.0051 (  0.7%)   0.0023 (  0.8%)   0.0074 (  0.8%)   0.0075 (  0.8%)  Insert XRay ops
   0.0052 (  0.8%)   0.0022 (  0.8%)   0.0075 (  0.8%)   0.0074 (  0.8%)  Machine Optimization Remark Emitter #2
   0.0050 (  0.7%)   0.0021 (  0.7%)   0.0072 (  0.7%)   0.0072 (  0.7%)  X86 PIC Global Base Reg Initialization
   0.0048 (  0.7%)   0.0023 (  0.8%)   0.0071 (  0.7%)   0.0072 (  0.7%)  Contiguously Lay Out Funclets
   0.0048 (  0.7%)   0.0020 (  0.7%)   0.0068 (  0.7%)   0.0071 (  0.7%)  X86 Insert Cache Prefetches
   0.0048 (  0.7%)   0.0021 (  0.7%)   0.0069 (  0.7%)   0.0070 (  0.7%)  X86 vzeroupper inserter
   0.0048 (  0.7%)   0.0021 (  0.7%)   0.0069 (  0.7%)   0.0070 (  0.7%)  Local Stack Slot Allocation
   0.0049 (  0.7%)   0.0021 (  0.7%)   0.0070 (  0.7%)   0.0069 (  0.7%)  Lazy Machine Block Frequency Analysis
   0.0048 (  0.7%)   0.0022 (  0.8%)   0.0070 (  0.7%)   0.0069 (  0.7%)  X86 WinAlloca Expander
   0.0046 (  0.7%)   0.0021 (  0.7%)   0.0067 (  0.7%)   0.0069 (  0.7%)  X86 speculative load hardening
   0.0036 (  0.5%)   0.0032 (  1.1%)   0.0068 (  0.7%)   0.0068 (  0.7%)  Instrument function entry/exit with calls to e.g. mcount() (post inlining)
   0.0047 (  0.7%)   0.0020 (  0.7%)   0.0067 (  0.7%)   0.0068 (  0.7%)  X86 Discriminate Memory Operands
   0.0047 (  0.7%)   0.0021 (  0.7%)   0.0068 (  0.7%)   0.0068 (  0.7%)  StackMap Liveness Analysis
   0.0063 (  0.9%)   0.0000 (  0.0%)   0.0063 (  0.6%)   0.0068 (  0.7%)  Instrument function entry/exit with calls to e.g. mcount() (pre inlining)
   0.0047 (  0.7%)   0.0020 (  0.7%)   0.0067 (  0.7%)   0.0067 (  0.7%)  Live DEBUG_VALUE analysis
   0.0044 (  0.6%)   0.0019 (  0.7%)   0.0063 (  0.6%)   0.0066 (  0.7%)  Analyze Machine Code For Garbage Collection
   0.0045 (  0.6%)   0.0020 (  0.7%)   0.0065 (  0.7%)   0.0066 (  0.7%)  Lazy Machine Block Frequency Analysis #2
   0.0045 (  0.6%)   0.0018 (  0.6%)   0.0063 (  0.6%)   0.0064 (  0.7%)  Lazy Block Frequency Analysis
   0.0035 (  0.5%)   0.0025 (  0.8%)   0.0060 (  0.6%)   0.0061 (  0.6%)  Lower Garbage Collection Instructions
   0.0041 (  0.6%)   0.0017 (  0.6%)   0.0058 (  0.6%)   0.0060 (  0.6%)  Safe Stack instrumentation pass
   0.0031 (  0.5%)   0.0024 (  0.8%)   0.0055 (  0.6%)   0.0057 (  0.6%)  Shadow Stack GC Lowering
   0.0047 (  0.7%)   0.0000 (  0.0%)   0.0047 (  0.5%)   0.0046 (  0.5%)  CallGraph Construction
   0.0000 (  0.0%)   0.0004 (  0.1%)   0.0004 (  0.0%)   0.0004 (  0.0%)  Assumption Cache Tracker #2
   0.0002 (  0.0%)   0.0000 (  0.0%)   0.0002 (  0.0%)   0.0002 (  0.0%)  Pre-ISel Intrinsic Lowering
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Force set function attributes
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Rewrite Symbols
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  A No-Op Barrier Pass
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Assumption Cache Tracker
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Target Library Information
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Machine Module Information
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Target Transform Information
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Profile summary info #2
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Machine Branch Probability Analysis
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Target Pass Configuration
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Create Garbage Collector Module Metadata
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Target Library Information #2
   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)   0.0000 (  0.0%)  Profile summary info
   0.6896 (100.0%)   0.2897 (100.0%)   0.9793 (100.0%)   0.9842 (100.0%)  Total

===-------------------------------------------------------------------------===
                          Clang front-end time report
===-------------------------------------------------------------------------===
  Total Execution Time: 3.6623 seconds (3.6902 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   3.0357 (100.0%)   0.6266 (100.0%)   3.6623 (100.0%)   3.6902 (100.0%)  Clang front-end timer
   3.0357 (100.0%)   0.6266 (100.0%)   3.6623 (100.0%)   3.6902 (100.0%)  Total

3 存在的问题

In the previous blog post I talked about how it is hard to get “useful” information on where C++ compilers spend their time. Various compilers have various ways of reporting something, but most of their reports seem to be geared towards the compiler developers themselves. For them it’s important to know, for example, whether register allocator is the bottleneck; for me as a compiler user that is much less of an importance – I want to know whether I’m bottlenecked by preprocessor / includes (if so, which ones?), parsing (if so, which classes/functions/templates?), template instantiation (if so, which ones?), code generation, backend optimizations, or something else.

4 参考链接

[1] https://aras-p.info/blog/2019/01/12/Investigating-compile-times-and-Clang-ftime-report/

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值