-
Notifications
You must be signed in to change notification settings - Fork 797
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
Activate Server mode for .NET Core compiler #13740
Conversation
Curious - what is the difference on your machine after the change? |
Nvm, found it on another issue |
I'm doing some more validation here |
I've put additional end-to-end build time validation in #13739. My analysis was incorrect - one multicore is taken into account, Server GC is a win. This means we should instead turn on server GC for .NET 6/7 |
"rollForwardOnNoCandidateFx": 2 | ||
"rollForwardOnNoCandidateFx": 2, | ||
"configProperties": { | ||
"System.GC.Server": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzarytovskii You mentioned that you thought arcade would handle server mode - it looks like it needs to go in this config file??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However I'm sceptical that this is the runtimeconfig.template.json used for the final fsc.dll
put into the .NET SDK, because this setting rollForwardOnNoCandidateFx
doesn't seem to appear in the SDK fsc.runtimeconfig.json
, which currently looks like this:
C:\Program Files\dotnet\sdk\7.0.100-preview.7.22377.5\FSharp\fsc.runtimeconfig.json
{
"runtimeOptions": {
"tfm": "net7.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "7.0.0-preview.7.22375.6"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The place where Arcade specifies the runtimeconfig.template.json
to use is here:
<Project>
<PropertyGroup>
<!--
When building a .NET Core exe make sure to include the template runtimeconfig.json file
which has all of our global settings
-->
<UserRuntimeConfig Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(OutputType)' == 'Exe'">$(RepositoryEngineeringDir)config\runtimeconfig.template.json</UserRuntimeConfig>
</PropertyGroup>
</Project>
Presumably this config changes when building the actual .NET SDK. I'm concerned that Arcade is not giving us any way to insert the settings we need for fsc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all of the 'layout' portion of the SDK with respect to F# happens in this project file.
This is used to publish the F# folder by calling the Publish
target here.
So I'd look for a way to make that project take the already-templated outputs from dotnet/fsharp if possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah somehow fsc.runtimeconfig.json
and fsi.runtimeconfif.json
are being generated, I'll leave the details for others to work out. In short we want Server GC mode enabled for the compiler :)
I validated that when using these changes (including for bootstrap), the wall time for Using |
Unfortunately, activating Server GC across all compononents means we hit the problem where fsyacc gives an exception, at least in CI
Until we sort that out we should just enable it for fsc |
Got the stand-alone repro for the NRE in fsyacc: |
Co-authored-by: Theodore Tsirpanis <[email protected]>
@vzarytovskii In principle this can go in. But someone needs to own it to check it's how we should be doing it. And make sure that the necessary config setting is actually used in the .NET SDK |
FWIW At my company we've been manually setting Server GC when starting up Rider, which then gets propagated to all child processes, including Dotnet/MSBuild/FSC. Nice to see that this might become the default 👍 |
We probably need to do something on the SDK side, since those file aren't being propagated when we generate those. @baronfel what would be the easiest way for us to have servergc enabled in sdk? |
@vzarytovskii fsc is put into the SDK via the tool_fsc.csproj project, which copies files from the transport packages. I believe that project is what's generating the runtimeconfig.json. I then see that runtimeconfig.json copied in this target for fsc and fsi - so perhaps adding the project properties above would be all that's needed? @dsplaisted/@joeloff is this the correct interpretation of the tool runtimeconfig generation process? |
Co-authored-by: Daniel Plaisted <[email protected]>
@vzarytovskii I updated this based on @dsplaisted's feedback, which makes it much simpler Could I have you and the Microsoft team take this over? I do think it's a highly significant perf win for the compiler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this goes in and is merged into the .NET SDK, someone should verify that the updated setting actually makes it into the runtimeconfig that the F# compiler uses there.
Will this make it into .NET 7 RTM next week? |
no, .NET 7 freeze happened month or so ago, when 17.5 got branched. |
Oh, I remember why server gc was not merged, rc1, which is used in 17.5 branch, has a GC bug with fslexyacc crashing, rc2 has a fix, but is not supported by signing gate, and was failing our signed builds. |
This will likely need to be reverted, till when rc2+ will be supported in signed builds. |
This reverts commit e6275e8.
OK. With help from @baronfel, we figured out that it doesn't end up in runtimeconfig. |
Adjust GC settings based on analysis in #13739
Turning off Batch mode also decouples us from the impact of dotnet/runtime#74286 (except for needing the temporary workaround #13736 until these changes flow into an SDK compiler we can consume back here)
There are likely other GC tuning settings we could look into, see https://docs.microsoft.com/en-us/dotnet/core/runtime-config/garbage-collector