Skip to content

Excessive JITting in SDK build tasks #15558

@ladipro

Description

@ladipro

Summary

A lot of JITting is happening when dotnet build-ing an empty .NET Core console application. We seem to have a problem of rejecting native images, specifically with NuGet assemblies. It's not clear where the root cause is (SDK packaging? NuGet client build? runtime?) so opening at the highest layer of the stack.

Repro

Environment: Windows 10 19041, Xeon E5-1620 v2, .NET 5.0.102 SDK x64
Commands:

  1. dotnet new console
  2. dotnet build /t:Rebuild

~600 methods from NuGet assemblies are JITted. Trace: PerfViewData.etl.zip

After manually running crossgen on them, this number goes down to ~190, suggesting that native images shipped with the SDK are missing or being rejected. Build time improves by ~100 ms.

The most affected build tasks are RestoreTask, GenerateDepsFile, and ProcessFrameworkReferences.

There may be room for improvement in Microsoft.NET.Build.Tasks.dll itself as well (~450 methods JITted) although I didn't see this number change after manually crossgening the assembly.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions