I am trying to understand some performance summary output from MSBuild. The results look like this:
Target Performance Summary:
0 ms PrepareForRun 74 calls
0 ms Compile 74 calls
...
...
...
...
15173 ms ResolveProjectReferences 74 calls
29607 ms Build 75 calls
Task Performance Summary:
2 ms CreateCSharpManifestResourceName 6 calls
2 ms ResolveKeySource 1 calls
...
...
...
...
3623 ms Copy 511 calls
7468 ms ResolveAssemblyReference 74 calls
11234 ms Exec 12 calls
48600 ms MSBuild 210 calls
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:29.60
Why does the total time for MSBuild exceed the total elapsed time? The actual stopwatch time to run this build was, in fact, ~29 seconds. Any examples of these summaries that I see online show that the total Task and Target times are same.
The MSBuild and CallTarget tasks invoke other targets (and thus other tasks). The time spent in those tasks is counted against the MSBuild and CAllTarget tasks as well. A bug, really.
So when reading this data, always ignore those two tasks. Summing the other tasks should come to a little less than the total build time.