Skip to content

Slower build times with SDK 10 compared to 8 #52105

@jairbubbles

Description

@jairbubbles

Describe the bug

While testing SDK 10 on a net8.0 solution (no TFM change, just the version in global.json), I noticed increased build times by something like 50%.

After some investigation, it doesn't seem to be linked to analyzers but to the Csc tasks taking more time.

To Reproduce

The initial project on which I noticed the issue is internal so I looked for an open source project on which I can reproduce the issue and pick https://github.com/aws/aws-sdk-net/

  • Just clone the project and restore the packages.
  • Then I'm using hyperfine to compare build times (to make sure analyzers are out of the equation I'm passing /p:RunAnalyzersDuringBuild=false):
hyperfine -L config "Debug" -L sdk_version "8.0.407,10.0.101" -N --setup "dotnet new globaljson --sdk-version {sdk_version} --force" --prepare "dotnet clean AWSSDK.NetStandard.sln /p:Configuration={config}" "dotnet build AWSSDK.NetStandard.sln --no-restore /p:Configuration={config} /p:RunAnalyzersDuringBuild=false"
  • It will build several times so it will take some time and then I get:
dotnet build AWSSDK.NetStandard.sln --no-restore /p:Configuration=Debug /p:RunAnalyzersDuringBuild=false (sdk_version = 8.0.407) ran
    1.91 ± 0.12 times faster than dotnet build AWSSDK.NetStandard.sln --no-restore /p:Configuration=Debug /p:RunAnalyzersDuringBuild=false (sdk_version = 10.0.101)

It's almost 2 times slower 😩

binlog investigation

When I compare the binlogs I see that we're taking a lot more time in the Csc tasks.

SDK 8:
Image

SDK 10:
Image

I compared the Csc command lines but I didn't see any relevant differences.

I don't know how to dig further so I finally opened this issue.

Further technical details

details of dotnet --info

SDK .NET :
 Version:           10.0.101
 Commit:            fad253f51b
 Workload version:  10.0.100-manifests.c57ac48b
 MSBuild version:   18.0.6+fad253f51

Environnement d'exécution :
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.101\

Charges de travail .NET installées :
Il n'y a aucune charge de travail installée à afficher.
Configuré pour utiliser desworkload sets lors de l’installation de nouveaux manifestes.
Aucun ensemble de charges de travail n’est installé. Exécutez « dotnet workload restore » pour installer un ensemble de charge de travail.

Host:
Version: 10.0.1
Architecture: x64
Commit: fad253f51b

.NET SDKs installed:
8.0.407 [C:\Program Files\dotnet\sdk]
9.0.100 [C:\Program Files\dotnet\sdk]
9.0.201 [C:\Program Files\dotnet\sdk]
9.0.305 [C:\Program Files\dotnet\sdk]
10.0.100 [C:\Program Files\dotnet\sdk]
10.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
D:\Git\aws-sdk-net\sdk\global.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions