提交 de252237 编写于 作者: M MichaelMaio 提交者: Tomáš Matoušek

Adjust ngen priority of assemblies for perf gains (#37485)

* Adjust ngen priority of assemblies for perf gains

These changes support an effort to improve VS performance after an update by tuning the assemblies ngen'd during setup.

After this change, the following assemblies should be ngen'd at priority 1:

common7\ide\commonextensions\microsoft\managedlanguages\vbcsharp\languageservices\microsoft.codeanalysis.csharp.dll
common7\ide\commonextensions\microsoft\managedlanguages\vbcsharp\languageservices\microsoft.codeanalysis.dll
common7\ide\commonextensions\microsoft\managedlanguages\vbcsharp\languageservices\microsoft.codeanalysis.features.dll
common7\ide\commonextensions\microsoft\managedlanguages\vbcsharp\languageservices\microsoft.codeanalysis.remote.servicehub.dll
common7\ide\commonextensions\microsoft\managedlanguages\vbcsharp\languageservices\microsoft.codeanalysis.workspaces.dll
common7\ide\commonextensions\microsoft\managedlanguages\vbcsharp\languageservices\microsoft.visualstudio.languageservices.dll

* Adjust ngen priority of assemblies for perf gains

These changes support an effort to improve VS performance after an update by tuning the assemblies ngen'd during setup.

After this change, the following assemblies should be ngen'd at priority 1:

msbuild\current\bin\roslyn\microsoft.build.tasks.codeanalysis.dll
msbuild\current\bin\roslyn\microsoft.codeanalysis.csharp.dll
msbuild\current\bin\roslyn\microsoft.codeanalysis.dll
msbuild\current\bin\roslyn\vbcscompiler.exe

* Undoing ngen priority changes in wrong file.

* Adjust ngen priority of assemblies for perf gains

These changes support an effort to improve VS performance after an update by tuning the assemblies ngen'd during setup.

After this change, the following assemblies should be ngen'd at priority 1:

msbuild\current\bin\roslyn\microsoft.build.tasks.codeanalysis.dll
msbuild\current\bin\roslyn\microsoft.codeanalysis.csharp.dll
msbuild\current\bin\roslyn\microsoft.codeanalysis.dll
msbuild\current\bin\roslyn\vbcscompiler.exe

* Set ngen priority to 1 for two System assemblies

After this change, the following assemblies should be ngen'd at priority 1:

msbuild\current\bin\roslyn\system.collections.immutable.dll
msbuild\current\bin\roslyn\system.reflection.metadata.dll

* Update DesktopCompilerArtifacts.targets

* Stop ngen'ing vbc.exe and csc.exe as pri1

The feedback we've gotten about build slow-down after VS update focused on IDE build and not command line build. We're working on a change in VS to start ngen'ing pri1 assemblies synchronously during Setup, and so we want to restrict that only to assemblies for which analysis shows a significant perf impact to the IDE start, open solution, and build solution scenarios.

* Set ngen priority to 2 for csc.exe and vbc.exe

I was intending to set these to pri2 with the previous change, but instead removed the prioritization altogether, which would leave it at the default (3).

* Set ngen priority to 2 for csi.exe

Per discussion with Roslyn team, this exe should have negligible jit impact on performance.
上级 0d1f127c
......@@ -8,6 +8,12 @@
Ngen* attributes indicate how VS should NGEN the assemblies that are distributed by VS Setup.
NgenApplication is relative to the Roslyn install directory within MSBuild (i.e. MSBuild\15.0\Bin\Roslyn).
Assemblies NGEN'd as priority 1 are selected based on how much JIT time they contribute, when not NGEN'd,
to the Visual Studio scenarios listed below. The more JIT time required for an assembly, the more likely
there will be a noticeable performance impact.
1. Start the IDE.
2. Load a managed solution.
3. Build the solution.
Set OverwriteOptimizationData to true to replace optimization data already embedded in the assembly with data retrieved from VS training scenarios.
We only need to specify this for assemblies built outside or Roslyn repo since the projects in Roslyn repo are responsible for embedding
......@@ -18,25 +24,25 @@
<ItemGroup>
<!-- The Roslyn built binaries must be taken from these locations because this is the location where signing occurs -->
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis\$(Configuration)\netstandard2.0\Microsoft.CodeAnalysis.dll" NgenArchitecture="all" NgenApplication="VBCSCompiler.exe"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis\$(Configuration)\netstandard2.0\Microsoft.CodeAnalysis.dll" NgenArchitecture="all" NgenApplication="VBCSCompiler.exe" NgenPriority="1"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis\$(Configuration)\netstandard2.0\Microsoft.DiaSymReader.Native.amd64.dll"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis\$(Configuration)\netstandard2.0\Microsoft.DiaSymReader.Native.x86.dll"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp\$(Configuration)\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll" NgenArchitecture="all" NgenApplication="VBCSCompiler.exe"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp\$(Configuration)\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll" NgenArchitecture="all" NgenApplication="VBCSCompiler.exe" NgenPriority="1"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.Scripting\$(Configuration)\netstandard2.0\Microsoft.CodeAnalysis.Scripting.dll" NgenArchitecture="all" NgenApplication="csi.exe"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp.Scripting\$(Configuration)\netstandard2.0\Microsoft.CodeAnalysis.CSharp.Scripting.dll" NgenArchitecture="all" NgenApplication="csi.exe"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.VisualBasic\$(Configuration)\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.dll" NgenArchitecture="all" NgenApplication="VBCSCompiler.exe"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)csc\$(Configuration)\net472\csc.exe" NgenArchitecture="all" NgenApplication="csc.exe" NgenPriority="1"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)csc\$(Configuration)\net472\csc.exe" NgenArchitecture="all" NgenApplication="csc.exe" NgenPriority="2"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)csc\$(Configuration)\net472\csc.exe.config"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)csc\$(Configuration)\net472\csc.rsp"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\csi.exe" NgenArchitecture="all" NgenApplication="csi.exe" NgenPriority="1"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\csi.exe" NgenArchitecture="all" NgenApplication="csi.exe" NgenPriority="2"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\csi.exe.config"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\csi.rsp"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)vbc\$(Configuration)\net472\vbc.exe" NgenArchitecture="all" NgenApplication="vbc.exe" NgenPriority="1"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)vbc\$(Configuration)\net472\vbc.exe" NgenArchitecture="all" NgenApplication="vbc.exe" NgenPriority="2"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)vbc\$(Configuration)\net472\vbc.exe.config"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)vbc\$(Configuration)\net472\vbc.rsp"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)VBCSCompiler\$(Configuration)\net472\VBCSCompiler.exe" NgenArchitecture="all" NgenApplication="VBCSCompiler.exe" NgenPriority="1"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)VBCSCompiler\$(Configuration)\net472\VBCSCompiler.exe.config"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.Build.Tasks.CodeAnalysis\$(Configuration)\net472\Microsoft.Build.Tasks.CodeAnalysis.dll" NgenArchitecture="all" />
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.Build.Tasks.CodeAnalysis\$(Configuration)\net472\Microsoft.Build.Tasks.CodeAnalysis.dll" NgenArchitecture="all" NgenPriority="1"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.Build.Tasks.CodeAnalysis\$(Configuration)\net472\Microsoft.Managed.Core.targets"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.Build.Tasks.CodeAnalysis\$(Configuration)\net472\Microsoft.Managed.EditorConfig.targets"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)Microsoft.Build.Tasks.CodeAnalysis\$(Configuration)\net472\Microsoft.CSharp.Core.targets"/>
......@@ -62,6 +68,8 @@
<_NoNGen Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Numerics.Vectors.dll"/>
<DesktopCompilerArtifact Include="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.*.dll" Exclude="@(_NoOptimizationData)" NgenArchitecture="all" NgenApplication="VBCSCompiler.exe" OverwriteNgenOptimizationData="true"/>
<DesktopCompilerArtifact Update="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Collections.Immutable.dll" NgenPriority="1" />
<DesktopCompilerArtifact Update="$(ArtifactsBinDir)csi\$(Configuration)\net472\System.Reflection.Metadata.dll" NgenPriority="1" />
<DesktopCompilerArtifact Include="@(_NoOptimizationData)" Exclude="@(_NoNGen)" NgenArchitecture="all" NgenApplication="VBCSCompiler.exe" OverwriteNgenOptimizationData="false"/>
<DesktopCompilerArtifact Include="@(_NoNGen)" />
......
......@@ -27,11 +27,13 @@
<Name>CodeAnalysis</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;SatelliteDllsProjectOutputGroup</IncludeOutputGroupsInVSIX>
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
<NgenPriority>1</NgenPriority>
</ProjectReference>
<ProjectReference Include="..\..\Compilers\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.csproj">
<Name>CSharpCodeAnalysis</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;SatelliteDllsProjectOutputGroup</IncludeOutputGroupsInVSIX>
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
<NgenPriority>1</NgenPriority>
</ProjectReference>
<ProjectReference Include="..\..\Compilers\VisualBasic\Portable\Microsoft.CodeAnalysis.VisualBasic.vbproj">
<Name>BasicCodeAnalysis</Name>
......@@ -133,6 +135,7 @@
<Name>Features</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;SatelliteDllsProjectOutputGroup</IncludeOutputGroupsInVSIX>
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
<NgenPriority>1</NgenPriority>
</ProjectReference>
<ProjectReference Include="..\..\Features\LanguageServer\Protocol\Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj">
<Name>LanguageServerProtocol</Name>
......@@ -158,6 +161,7 @@
<Name>Workspaces</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;SatelliteDllsProjectOutputGroup</IncludeOutputGroupsInVSIX>
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
<NgenPriority>1</NgenPriority>
</ProjectReference>
<ProjectReference Include="..\..\Workspaces\Core\MSBuild\Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj">
<Name>Workspaces.MSBuild</Name>
......@@ -179,6 +183,7 @@
<Name>ServicesVisualStudio</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;PkgDefProjectOutputGroup;VsdConfigOutputGroup;SatelliteDllsProjectOutputGroup</IncludeOutputGroupsInVSIX>
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
<NgenPriority>1</NgenPriority>
</ProjectReference>
<ProjectReference Include="..\Core\Impl\Microsoft.VisualStudio.LanguageServices.Implementation.csproj">
<Name>ServicesVisualStudioImpl</Name>
......@@ -225,6 +230,7 @@
<Name>ServiceHub</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3b;SatelliteDllsProjectOutputGroup</IncludeOutputGroupsInVSIX>
<ForceIncludeInVSIX>true</ForceIncludeInVSIX>
<NgenPriority>1</NgenPriority>
</ProjectReference>
<ProjectReference Include="..\Razor\Microsoft.VisualStudio.LanguageServices.Razor.RemoteClient.csproj">
<Name>RazorVisualStudio</Name>
......@@ -305,4 +311,4 @@
<PackageReference Include="Microsoft.CodeAnalysis.FlowAnalysis.Utilities" Version="$(MicrosoftCodeAnalysisFlowAnalysisUtilitiesVersion)" PrivateAssets="all" />
</ItemGroup>
<Import Project="$(RepositoryEngineeringDir)targets\GenerateServiceHubConfigurationFiles.targets" />
</Project>
\ No newline at end of file
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册