Skip to content

Commit

Permalink
Avoid x-targeting perf impact on vcxproj
Browse files Browse the repository at this point in the history
Targeted mitigation for #1276.

VC++ noticed a dramatic regression in solution-load performance related to
the time cost of ResolveProjectReferences. That affects all projects, but
we can safely assume that a .vcxproj is NOT using cross-targeting, while
it's impossible to detect from the outside whether a .csproj is.

This commit avoids the regression for C++ projects by just not calling the
MSBuild task again for .vcxproj references.
  • Loading branch information
rainersigwald committed Oct 27, 2016
1 parent 2964bfe commit 7267638
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/XMakeTasks/Microsoft.Common.CurrentVersion.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,12 @@ Copyright (C) Microsoft Corporation. All rights reserved.
======================================================================================
-->
<Target Name="_GetProjectReferenceTargetFrameworkProperties" Outputs="%(_MSBuildProjectReferenceExistent.Identity)">
<!-- As a mitigation for https://github.com/Microsoft/msbuild/issues/1276
.vcxproj is treated specially to avoid the cost of double-evaluating
for the easily-identifiable-as-not-cross-targeting C++ projects. -->
<Target Name="_GetProjectReferenceTargetFrameworkProperties"
Outputs="%(_MSBuildProjectReferenceExistent.Identity)"
Condition="'%(_MSBuildProjectReferenceExistent.Extension)' != '.vcxproj'">
<MSBuild
Projects="%(_MSBuildProjectReferenceExistent.Identity)"
Targets="GetTargetFrameworkProperties"
Expand Down

0 comments on commit 7267638

Please sign in to comment.