Skip to content

Performance Regression: Build takes 7s in .net9 and 5min in .net10 #19169

Open

Description

@marklam

https://github.com/marklam/SlowBuildRepro
Build is fine with global.json selecting .net 9, very slow when using .net 10

Known workarounds

Select .net 9 SDK

Related information

  • Windows 11
  • .net 10
  • Visual Studio 18 Insiders

Activity

  1. added theissue type on Dec 18, 2025
  2. added this to the Backlog milestone on Dec 18, 2025
  3. majocha commented on Dec 18, 2025

    @majocha
    Contributor

    I can confirm this was fast even with rc sdk 10.0.100.

    Upgrading to 10.0.101 - build takes forever.

    Using the fsc.dll from main, it's fast again:

    ❯ dotnet build -c Release -p:DotnetFscCompilerPath=D:\source\fsharp\artifacts\bin\fsc\Release\net10.0\fsc.dll -bl --no-incremental
    Restore complete (0.4s)
      SlowBuild net9.0 succeeded (8.0s) → SlowBuild\bin\Release\net9.0\SlowBuild.dll
    
    Build succeeded in 8.7s
    

    I think this is already fixed as of latest changes in main.

    Removing
    <FSharpPreferNetFrameworkTools>False</FSharpPreferNetFrameworkTools>

    made it fast for me also when building in the IDE. I guess this option forces VS to use the released SDK 10.0.101 which has the unfortunate bug. and without it, msbuild uses the vsix provided one.

  4. T-Gro commented on Dec 18, 2025

    @T-Gro
    Member

    FSharpPreferNetFrameworkTools = true (also the default in VS) ===> uses the net472 build of the compiler, shipped with VS and runs on the desktop .NET Framework.

    FSharpPreferNetFrameworkTools = false (the default in the SDK) ===> uses the net10 build of the compiler, shipped with .NET SDK

    At time likes the one we are at, the exact timing of the two platforms (release cadence SDK vs VS) can be different, even though they are sourced from the same F# code.

  5. majocha commented on Dec 18, 2025

    @majocha
    Contributor

    FSharpPreferNetFrameworkTools = true (also the default in VS) ===> uses the net472 build of the compiler, shipped with VS and runs on the desktop .NET Framework.

    Stupid question but does F# net472 compiler actually ship with VisualFSharp vsix or separately as part of VS?

  6. T-Gro commented on Dec 18, 2025

    @T-Gro
    Member

    Is what you have after installation at (e.g.): C:\Program Files\Microsoft Visual Studio\18\Insiders\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools

    https://github.com/dotnet/fsharp/blob/main/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest

    It should all be part of the same .vsix with all other tools

  7. T-Gro commented on Dec 18, 2025

    @T-Gro
    Member

    But if you install an override via a custom built .vsix, I am afraid it will not replace the built-in ones and F# .props and .targets will still refer the built in one.
    For the same reason why it was not used for F5 on VisualFSharpDebug and it needed env var overrides to point to the local one.

  8. marklam commented on Dec 18, 2025

    @marklam
    Author

    Without the <FSharpPreferNetFrameworkTools>False</FSharpPreferNetFrameworkTools> and with a custom vsix, it builds quickly in Visual Studio Insiders.

    But it still takes a long time from dotnet build.

    Without a custom vsix, in Visual Studio GA it may well take a lifetime.

  9. T-Gro commented on Dec 22, 2025

    @T-Gro
    Member

    I made this repro part of CI #19170 , it builds fine on current main - this will ship with NET SDK 10.0.200.

    Lets keep it in, as we did not have other UMX test cases in the compiler repository until now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions