Viladoman / CompileScore

Tools for profiling and visualizing C++ build times.
MIT License
460 stars 19 forks source link

feature suggestion: Display top level aggregate stats #8

Open ikrima opened 3 years ago

ikrima commented 3 years ago

One thing i've incorporated for a small dev quality of life/lazyness thing is running https://github.com/aras-p/ClangBuildAnalyzer alongside CompileScore.

It dumps out an aggregate summary that I find pretty useful (ex: longest files to parse, codegen, longest template sets, etc)

Might be useful in CompileScore?

Viladoman commented 3 years ago

I don't completely understand your suggestion. The same data should be on the different tabs if you sort them by time. Do you mean having like a recap of each tab in a single place for 'Major offenders' kind of thing?

ikrima commented 3 years ago

ah sorry wasn't clear. yup, just meant having the data collated in one "Major offenders" tab (or it could go into the Totals view)

For comparison, here's the dump from clangbuild analyzer that imho would be nice to go into said tab:

**** Time summary:
Compilation (436 times):
  Parsing (frontend):          292.9 s
  Codegen & opts (backend):     36.3 s

**** Files that took longest to parse (compiler frontend):
  5909 ms: XXXXXXXXXXXXXXXXXXXXXXX
  5908 ms: XXXXXXXXXXXXXXXXXXXXXXX
  5892 ms: XXXXXXXXXXXXXXXXXXXXXXX
  ====trimmed for example====

**** Files that took longest to codegen (compiler backend):
  2750 ms: XXXXXXXXXXXXXX
  1100 ms: XXXXXXXXXXXXXX
   843 ms: XXXXXXXXXXXXXX
   ====trimmed for example====

**** Templates that took longest to instantiate:
  1524 ms: std::basic_string<char, std::char_traits<char>, std::allocator<char>... (507 times, avg 3 ms)
   705 ms: std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator... (335 times, avg 2 ms)
   604 ms: mlir::Dialect::addOperations<mlir::tlv::opgrph::DispatchExecEndOp, m... (1 times, avg 604 ms)
   ====trimmed for example====

**** Template sets that took longest to instantiate:
 21413 ms: mlir::Op<$> (2964 times, avg 7 ms)
 17298 ms: mlir::detail::FilterTypes<$> (5205 times, avg 3 ms)
  9390 ms: std::_Tuple_cat1<$> (2787 times, avg 3 ms)
 ====trimmed for example====

**** Functions that took longest to compile:
   146 ms: void __cdecl es2::XXXXXXXXXX(unsigned __int64) (XXXXXXXXXXXXXXXXXXXXXXX.cpp)
   103 ms: public: static void __cdecl es2::XXXXXXXXXXX::XXXXXXXXX(void) (XXXXXXXXXXXXXXXXXXXXXXX.cpp)
    90 ms: int __cdecl tracy::LZ4_compress_fast_continue(union tracy::LZ4_strea... (XXXXXXXXXXXXXXXXXXXXXXX.cpp)
   ====trimmed for example====

**** Function sets that took longest to compile / optimize:
   187 ms: void __cdecl ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C_... (9 times, avg 20 ms)
   112 ms: public: void __cdecl es2::ArrayStrg_o<$>::strgReserve(int) (77 times, avg 1 ms)
   111 ms: void __cdecl ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C_... (2 times, avg 55 ms)
   ====trimmed for example====

*** Expensive headers:
21591 ms: XXXXXXXXXXXXXXXXXXXXXX.h (included 62 times, avg 348 ms), included via:
  XXXXXXXXXXXXX.obj XXXXXXXXXXXXX.h XXXXXXXXXXXXX.h XXXXXXXXXXXXX.h XXXXXXXXXXXXX.h  (1524 ms)
  XXXXXXXXXXXXX.obj XXXXXXXXXXXXX.h XXXXXXXXXXXXX.h XXXXXXXXXXXXX.h XXXXXXXXXXXXX.h  (1487 ms)
  ...

17163 ms: ../../../pub/llvm/mlir/include/mlir/Dialect/StandardOps/IR/Ops.h (included 15 times, avg 1144 ms), included via:
  es2dslsubsys_mlirdialects.obj AffineOps.h  (1387 ms)
  toy_lowertoaffine.obj AffineOps.h  (1247 ms)
  es2tlv_ops.obj  (1232 ms)
  es2tlv_dialect.obj  (1225 ms)
  es2tlvpass_linalgtilefuse.obj AffineOps.h  (1190 ms)
  es2opgrph_ops.obj  (1176 ms)
  ...  

====trimmed for example====
Viladoman commented 3 years ago

I think it is a cool idea. I am currently in the middle of some big changes to the whole thing, so I will park this in the suggestion box for now and go back to it once I have the 'build and profile' feature ready. This way we can also figure out the best way to visualize this data properly from a presentation point of view.