Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent dotnet process spawn on compiler startup #13969

Merged
merged 9 commits into from
Oct 6, 2022
Merged

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented Sep 23, 2022

Fixes #13960

@vzarytovskii I think searching for "Microsoft.NETCore.App.Ref" in the directory name is adequate for now.

I did a performance comparison and on my laptop running:

C:\GitHub\dsyme\fsharp\artifacts\bin\fsc\Release\net7.0\fsc.exe @out.args

Before: 2.9s
After: 2.7s

The proportional effect is greater if crossgen is active and you can actually measure the effect in the SDK today, as the process spawn only kicks in if non-default assemblies are referenced, e.g.

  1. Make an out.args for a simple project referencing Newtonsoft.Json

  2. dotnet "\Program Files\dotnet\sdk\7.0.100-rc.1.22431.12\FSharp\fsc.dll" @out.args --times

  3. Then remove this reference from the list and repeat

      -r:C:\Users\donsy\.nuget\packages\newtonsoft.json\13.0.1\lib\netstandard2.0\Newtonsoft.Json.dll
    

Before: consistently 1.7s
After: consistently 1.5s

@dsyme
Copy link
Contributor Author

dsyme commented Sep 23, 2022

@vzarytovskii This is ready

@baronfel
Copy link
Member

baronfel commented Sep 23, 2022

Longer term it might be nice if the SDK surfaced some way of resolving named Frameworks from the current install location via a NuGet package. We already ship resolvers for finding installed and usable SDKs, and I think the next step of "give me framework X from SDK Y" would enable use cases for scripting (like #r "framework: ...") that we've talked about here for a while.

@dsyme
Copy link
Contributor Author

dsyme commented Sep 27, 2022

@vzarytovskii @KevinRansom ping :)

@vzarytovskii
Copy link
Member

@KevinRansom can you please take a look at it?

@KevinRansom KevinRansom merged commit 89e91dd into dotnet:main Oct 6, 2022
abonie pushed a commit to abonie/fsharp that referenced this pull request Oct 7, 2022
* don't start process to determine system assemblies

* code format

* fix build break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fsc on .NET 6/7 is spawning dotnet process
5 participants