Page MenuHomePhabricator

[time-report] Add Template Instantiation Timer
Needs ReviewPublic

Authored by eduardo-elizondo on Aug 20 2017, 8:03 PM.

Details

Summary

This adds the "Template Instantiation Time" timer when running -ftime-report. Gcc already provides this.

i.e:

===-------------------------------------------------------------------------===
                         Miscellaneous Ungrouped Timers
===-------------------------------------------------------------------------===

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   0.0170 ( 63.0%)   0.0000 (  0.0%)   0.0170 ( 60.7%)   0.0168 ( 60.7%)  Template Instantiation Time
   0.0090 ( 33.3%)   0.0010 (100.0%)   0.0100 ( 35.7%)   0.0099 ( 35.5%)  Code Generation Time
   0.0010 (  3.7%)   0.0000 (  0.0%)   0.0010 (  3.6%)   0.0010 (  3.8%)  LLVM IR Generation Time
   0.0270 (100.0%)   0.0010 (100.0%)   0.0280 (100.0%)   0.0278 (100.0%)  Total

This diffs depends on the reference-counted timer: D36847

Diff Detail

Event Timeline

eduardo-elizondo edited the summary of this revision. (Show Details)Aug 20 2017, 8:07 PM
eric_niebler edited edge metadata.Aug 21 2017, 11:29 AM

This appears to be only measuring the time spent instantiating class templates. What about other template entities, like functions?

@eric_niebler You are right, we should also time: Sema::InstantiateFunctionDefinition

Added timing to Function Instantiations as well