Back to Msbuild

MSBuild evaluation profiling

documentation/evaluation-profiling.md

18.4.04.8 KB
Original Source

MSBuild evaluation profiling

MSBuild 15.6 and higher contains an evaluation profiler, which can help analyze which parts of a project (and any .targets/etc that it imports) are taking the most time to evaluate.

The profiler is enabled when passing /profileevaluation:<filename> as a command-line argument to MSBuild. After the build, the specified file will contain a profiler report. If the specified filename does not end in .md, it will be a tab-separated value (TSV) table suitable for loading into a spreadsheet. If the filename ends in .md, it will be a Markdown file that looks like the following:

PassFileLine #ExpressionInc (ms)Inc (%)Exc (ms)Exc (%)#Bug
Total Evaluation650100%172.7%1
Initial Properties (Pass 0)50.8%50.8%1
Properties (Pass 1)36055.4%30.4%1
ItemDefinitionGroup (Pass 2)91.4%00%1
Items (Pass 3)639.7%10.2%1
Lazy Items (Pass 3.1)17326.6%294.5%1
UsingTasks (Pass 4)81.2%81.2%1
Targets (Pass 5)152.3%10.2%1
Properties (Pass 1)MVC.csproj0<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.Web" />35154%7611.7%1
Items (Pass 3)Microsoft.NETCore.App.props8<PackageConflictPlatformManifests Include="$(MSBuildThisFileDirectory)Microsoft.NETCore.App.Platform...375.7%375.7%1
Properties (Pass 1)Microsoft.Common.CurrentVersion.targets83<FrameworkPathOverride Condition="'$(FrameworkPathOverride)' == ''" >$([Microsoft.Build.Utilities.To...324.9%324.9%1
Lazy Items (Pass 3.1)Microsoft.NET.Sdk.DefaultItems.props26<Compile Include="**/*$(DefaultLanguageSourceExtension)" Exclude="$(DefaultItemExcludes);$(DefaultEx...314.7%314.7%1
Properties (Pass 1)Microsoft.Common.targets114<Import Project="$(CommonTargetsPath)" />9514.6%233.5%1
Lazy Items (Pass 3.1)Microsoft.NET.Sdk.Web.ProjectSystem.props29<Content Include="wwwroot\**" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultItemExcludes...172.6%172.6%1
Properties (Pass 1)Microsoft.Common.CurrentVersion.targets92<TargetPlatformSdkPath Condition="'$(TargetPlatformSdkPath)' == ''" >$([Microsoft.Build.Utilities.To...152.3%152.3%1
Lazy Items (Pass 3.1)Microsoft.NET.Sdk.DefaultItems.targets156Condition="'%(LinkBase)' != ''")121.9%121.9%1
Properties (Pass 1)Microsoft.Common.props15Condition="'$(ImportByWildcardBeforeMicrosoftCommonProps)' == ''")121.9%121.9%1
Properties (Pass 1)Microsoft.Common.props63<Import Project="$(MSBuildProjectExtensionsPath)$(MSBuildProjectFile).*.props" Condition="'$(ImportP...182.8%121.8%1
Properties (Pass 1)Microsoft.CSharp.targets168<Import Project="$(CSharpTargetsPath)" />16425.2%111.7%1
Properties (Pass 1)MVC.csproj.nuget.g.targets7<Import Project="$(NuGetPackageRoot)netstandard.library\2.0.0\build\netstandard2.0\NETStandard.Libra...142.2%111.7%1
Lazy Items (Pass 3.1)Microsoft.NET.Sdk.DefaultItems.props30<None Include="**/*" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />101.6%101.6%1
Properties (Pass 1)Sdk.props29<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />568.6%101.5%1
Items (Pass 3)Microsoft.Common.CurrentVersion.targets368Condition="'$(OutputType)' != 'winmdobj' and '@(_DebugSymbolsIntermediatePath)' == ''")91.4%91.4%1
ItemDefinitionGroup (Pass 2)Microsoft.Common.CurrentVersion.targets1661<ProjectReference ><!-- Target to build in the project reference; by default, this property is blank...81.3%81.3%1
Lazy Items (Pass 3.1)Microsoft.Common.CurrentVersion.targets369<_DebugSymbolsOutputPath Include="@(_DebugSymbolsIntermediatePath-&gt;'$(OutDir)%(Filename)%(Extensi...81.2%81.2%1
Lazy Items (Pass 3.1)Microsoft.NET.Sdk.Web.ProjectSystem.props32<Content Include="**\*.json" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultItemExcludes)...81.2%81.2%1
Properties (Pass 1)MVC.csproj.nuget.g.targets9<Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.configuration....81.2%71.1%1
Lazy Items (Pass 3.1)Microsoft.NET.Sdk.Web.ProjectSystem.props39<Compile Remove="wwwroot\**" />71.1%71.1%1
Lazy Items (Pass 3.1)Microsoft.NET.Sdk.Web.ProjectSystem.props31<Content Include="**\*.cshtml" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultItemExclude...71.1%71.1%1
Lazy Items (Pass 3.1)Microsoft.NET.Sdk.Web.ProjectSystem.props30<Content Include="**\*.config" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultItemExclude...71.1%71.1%1
Lazy Items (Pass 3.1)Microsoft.NET.Sdk.DefaultItems.props27<EmbeddedResource Include="**/*.resx" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFold...71.1%71.1%1
Properties (Pass 1)Sdk.targets41<Import Project="$(LanguageTargets)" />17126.2%71%1