Skip to content

[.NET] Build time is slower #10251

@rolfbjarne

Description

@rolfbjarne

Build time is significantly slower with .NET 6 than with Xamarin.iOS.

cd tests/dotnet
git clean -xfdq
make compare

Then check the bin logs in the tests/dotnet directory.

Xamarin.iOS takes 11s to build:

$ msbuild /v:diag build-oldnet.binlog | tail -n 15
       62 ms  ResolveAssemblyReference                   1 calls
       69 ms  DetectSigningIdentity                      1 calls
      103 ms  DetectSdkLocations                         1 calls
      119 ms  SymbolStrip                                1 calls
      126 ms  SpotlightIndexer                           1 calls
      186 ms  Codesign                                   2 calls
      653 ms  DSymUtil                                   1 calls
      772 ms  Csc                                        1 calls
     8388 ms  MTouch                                     1 calls

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:11.24

.NET 6 takes 18s to build:

$ msbuild /v:diag build-dotnet.binlog | tail -n 15
      200 ms  MSBuild                                    7 calls
      296 ms  LinkNativeCode                             1 calls
      393 ms  GenerateDepsFile                           2 calls
      501 ms  Codesign                                   2 calls
      917 ms  Csc                                        1 calls
     1185 ms  AOTCompile                                 1 calls
     1222 ms  CopyRefAssembly                            1 calls
     3276 ms  CompileNativeCode                          2 calls
     8576 ms  ILLink                                     1 calls

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:18.55

The ILLink task significantly longer than the MTouch task used to take (which also includes AOT compilation and native code compilation).

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnetAn issue or pull request related to .NET (6)enhancementThe issue or pull request is an enhancementiOSIssues affecting iOSmacOSIssues affecting macOS

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions