Skip to content

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt requested a review from vijayrkn as a code owner June 15, 2023 23:22
@ghost ghost added Area-WebSDK untriaged Request triage from a team member labels Jun 15, 2023
@eerhardt
Copy link
Member Author

FYI @agocke @vitek-karas @MichalStrehovsky @jkotas for awareness.


responseFileContents.Should().Contain("--feature:System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault=false");
responseFileContents.Should().Contain("--feature:System.Diagnostics.Tracing.EventSource.IsSupported=true");
responseFileContents.Should().Contain("--runtimeknob:System.GC.DynamicAdaptationMode=1");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's literally called --runtimeknob? 😆

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/dotnet/runtime/blob/3afe6bd73788bd941dc06e4160616dc100bbcc43/src/coreclr/tools/aot/ILCompiler/ILCompilerRootCommand.cs#L95-L96

        public Option<string[]> RuntimeKnobs { get; } =
            new(new[] { "--runtimeknob" }, Array.Empty<string>, "Runtime knobs to set");

😆

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In CoreCLR lingo, the settings one can set through environment variables are "config values" (e.g. DOTNET_gcServer=1). The values in runtimeconfig.json are "knob values" (e.g. System.GC.Server=true).

I can't say I'm thrilled to see the existence/name/contents of the RSP file interpreted outside of the dotnet/runtime repo though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I'm thrilled to see the existence/name/contents of the RSP file interpreted outside of the dotnet/runtime repo though.

Agreed this isn't ideal. But I can't really think of a better way to ensure the properties are flown correctly. Running the app, giving it load, and inspecting its memory usage would be the "real" way to test it. But that's too heavy handed.

The good news is that this is limited to a very small subset of tests (namely 1) to ensure we have the right defaulting logic in place. If we ever change these ilc command line argument names, it is simple to fix it here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed this isn't ideal. But I can't really think of a better way to ensure the properties are flown correctly. Running the app, giving it load, and inspecting its memory usage would be the "real" way to test it. But that's too heavy handed.

If we're allowed to run the app, we also inspect AppContext (these also flow to AppContext), or there might be a GC API we can query directly. Similarly for the feature switches.

I'm not saying we need to do this because digging into RSP also works and this code is already written, but maybe for next time.

Copy link
Member

@DamianEdwards DamianEdwards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the one comment nit

@eerhardt eerhardt merged commit 13a0d41 into dotnet:main Jun 16, 2023
@eerhardt eerhardt deleted the Fix33298 branch June 16, 2023 20:46
eerhardt added a commit to eerhardt/Benchmarks that referenced this pull request Jun 16, 2023
dotnet/sdk#33309 enables GarbageCollectionAdaptationMode=1 by default for ASP.NET apps that use ServerGarbageCollection. Our Server GC benchmarks want to use the "normal" Server GC, so explicitly set the environment variable so they aren't using the adaptive mode.
eerhardt added a commit to aspnet/Benchmarks that referenced this pull request Jun 16, 2023
dotnet/sdk#33309 enables GarbageCollectionAdaptationMode=1 by default for ASP.NET NativeAOT apps that use ServerGarbageCollection. Our Server GC benchmarks want to use the "normal" Server GC, so explicitly set the environment variable so they aren't using the adaptive mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-WebSDK untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable dynamic adaptive GC by default in Web SDK when PublishAot==true

5 participants