Skip to content

Commit a35f5bf

Browse files
authored
Apply MIBC optimization data when building ASP.NET composite (#47333)
I have verified in the ASP.NET perf lab that the combined ASP.NET + framework composite image can achieve better startup perf by about 5% by using the standard MIBC optimization data so I'm proposing to modify the build script to use it. The resulting composite image is larger by about 850 KB (Linux x64 without MIBC = 33,853,952 B, with MIBC = 34,702,336 B) so I believe that thanks to the fact that I recently reduced the composite image size by more than 30 MB we have sufficient headroom to make this change. Thanks Tomas
1 parent 21de13b commit a35f5bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
426426
<PropertyGroup>
427427
<CrossgenToolPath>$([System.IO.Path]::Combine('$(Crossgen2PackageRoot)', 'tools', '$(Crossgen2ToolFileName)'))</CrossgenToolPath>
428428
<CrossgenSymbolsTargetDir>$(TargetDir)</CrossgenSymbolsTargetDir>
429+
<CrossgenOptimizationData Condition="'$(RuntimePackageRoot)' != ''">$(RuntimePackageRoot)tools\StandardOptimizationData.mibc</CrossgenOptimizationData>
430+
<CrossgenOptimizationData Condition="!Exists('$(CrossgenOptimizationData)')"></CrossgenOptimizationData>
429431

430432
<!-- Escaping (double backslash at end) required due to the way batch processes backslashes. -->
431433
<CrossgenSymbolsTargetDir Condition="HasTrailingSlash($(CrossgenSymbolsTargetDir)) AND '$(OS)' == 'Windows_NT'">$(TargetDir)\</CrossgenSymbolsTargetDir>
@@ -462,7 +464,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
462464
<Crossgen2Args>$(Crossgen2Args) --targetos:$(Crossgen2TargetOs)</Crossgen2Args>
463465
<Crossgen2Args>$(Crossgen2Args) -O</Crossgen2Args>
464466
<Crossgen2Args>$(Crossgen2Args) @&quot;$(CrossgenToolDir)PlatformAssembliesPathsCrossgen2.rsp&quot;</Crossgen2Args>
465-
<Crossgen2Args Condition="Exists('$(RuntimePackageRoot)tools\StandardOptimizationData.mibc')">$(Crossgen2Args) &quot;-m:$(RuntimePackageRoot)tools\StandardOptimizationData.mibc&quot;</Crossgen2Args>
467+
<Crossgen2Args Condition="'$(CrossgenOptimizationData)' != ''">$(Crossgen2Args) &quot;-m:$(CrossgenOptimizationData)&quot;</Crossgen2Args>
466468
<Crossgen2Args Condition="'$(GenerateCrossgenProfilingSymbols)' == 'true' and '$(TargetOsName)' == 'win'">$(Crossgen2Args) --pdb --pdb-path:&quot;$(CrossgenSymbolsTargetDir)&quot;</Crossgen2Args>
467469
<Crossgen2Args Condition="'$(GenerateCrossgenProfilingSymbols)' == 'true' and '$(TargetOsName)' != 'win'">$(Crossgen2Args) --perfmap --perfmap-format-version:1 --perfmap-path:&quot;$(CrossgenSymbolsTargetDir)&quot;</Crossgen2Args>
468470
</PropertyGroup>
@@ -517,6 +519,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
517519
<WriteLinesToFile File="$(CompositeResponseFile)" Lines="&quot;%(PartialCompositeAssemblyPaths.Identity)&quot;" Overwrite="false" />
518520
<WriteLinesToFile File="$(CompositeResponseFile)" Lines="--out:&quot;$(CompositeTargetDir)$(CompositeFileName).dll&quot;" Overwrite="false" />
519521
<WriteLinesToFile File="$(CompositeResponseFile)" Lines="--instruction-set:$(InstructionSetSupport)" Overwrite="false" Condition="'$(InstructionSetSupport)' != ''" />
522+
<WriteLinesToFile File="$(CompositeResponseFile)" Lines="-m:&quot;$(CrossgenOptimizationData)&quot;" Overwrite="false" Condition="'$(CrossgenOptimizationData)' != ''" />
520523

521524
<ItemGroup>
522525
<NativeSharedObjects Include="$(NativeAssetsFullPath)\*.so" />

0 commit comments

Comments
 (0)