Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_GenerateCompileDependencyCache is still consuming non-trivial time in design-time build #2442

Open
davkean opened this issue Aug 16, 2017 · 5 comments
Labels
performance Performance-Scenario-Solution-Open This issue affects solution open performance. Priority:2 Work that is important, but not critical for the release triaged

Comments

@davkean
Copy link
Member

davkean commented Aug 16, 2017

This was "fixed" here: #2276, but with latest bits in master, I'm still seeing this target and CoreCompile show up on the radar on an up-to-date build: dotnet/sdk#1496.

I thought CoreCompile was only supposed to be called on a dirty build?

@davkean
Copy link
Member Author

davkean commented Aug 16, 2017

Hmm, it seems CoreCompile is still being called when one of it's outputs doesn't exist:

Target "CoreCompile" in file "E:\msbuild\bin\Release\x86\Windows_NT\Output\Roslyn\Microsoft.CSharp.Core.targets" from project "BarBare.csproj" (target "Compile" depends on it):
Building target "CoreCompile" completely.
Output file "obj\Debug\FooBar.UnitTest.dll" does not exist.

Which means that _GenerateCompileDependencyCache is basically running for nothing in that case.

@davkean
Copy link
Member Author

davkean commented Aug 16, 2017

I think we should decide what's quicker in the design-time build case; calling _GenerateCompileDependencyCache or generating the command-line args. Does _GenerateCompileDependencyCache actually save anything when we're just generating command-line args?

@rainersigwald
Copy link
Member

I still think I agree that skipping it during design-time builds is reasonable. It's there only to catch the case that a file on disk was added or deleted and if so run the compiler. I expect that just generating the command line should be cheap enough to do for all DT builds.

The CoreCompile inputs/outputs will cause it to run every time in your pre-actual-build example, as well as when any source file has been saved but the build hasn't been run yet. The combination of the two is probably common enough to provide additional weight for this.

@davkean have you tried

-   <Target Name="_GenerateCompileDependencyCache" DependsOnTargets="ResolveAssemblyReferences">
+   <Target Name="_GenerateCompileDependencyCache" DependsOnTargets="ResolveAssemblyReferences" Condition="'$(DesignTimeBuild)' != 'true'">

@davkean
Copy link
Member Author

davkean commented Aug 17, 2017

@rainersigwald DesignTimeBuild is only set for new project system - so we need to come up with a combination of DesignTImeBuild and BuildingProject that avoids #2417.

@davkean
Copy link
Member Author

davkean commented Nov 10, 2017

This target is consuming the 6th most design-time build time in our new telemetry, with a 95% percentile time of 23 milliseconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance-Scenario-Solution-Open This issue affects solution open performance. Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

No branches or pull requests

6 participants