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

Use Knobs to populate AppContext switches #86883

Merged
merged 5 commits into from
May 31, 2023

Conversation

MichalStrehovsky
Copy link
Member

Previously AppContext switches were set by injecting a method that calls AppContext.SetSwitch at startup. Use the configuration blob added in #86068 instead. This makes startup a tiny bit faster and the outputs a tiny bit smaller.

Fixes #77054.

Cc @dotnet/ilc-contrib

Previously AppContext switches were set by injecting a method that calls `AppContext.SetSwitch` at startup. Use the configuration blob added in dotnet#86068 instead. This makes startup a tiny bit faster and the outputs a tiny bit smaller.

Fixes dotnet#77054.
@ghost
Copy link

ghost commented May 30, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Previously AppContext switches were set by injecting a method that calls AppContext.SetSwitch at startup. Use the configuration blob added in #86068 instead. This makes startup a tiny bit faster and the outputs a tiny bit smaller.

Fixes #77054.

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@@ -204,19 +239,19 @@ void RhConfig::ReadEmbeddedSettings(void *volatile * embeddedSettings, void* com
{
if (*embeddedSettings == NULL)
{
uint32_t size = ((CompilerEmbeddedSettingsBlob*)compilerEmbeddedSettingsBlob)->Size;
uint32_t count = ((CompilerEmbeddedSettingsBlob*)compilerEmbeddedSettingsBlob)->Count;
Copy link
Member Author

Choose a reason for hiding this comment

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

We're treating the size as count incorrectly in rest of the code (missed that in the code review). So this is also a bugfix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ended up deleting all of this.

It ran into an issue that we had a hard limit on how long a key or value can be and instead of writing more C code, I just deleted it and update the compiler to emit it in a format that we don't need to parse at all and just use as-is.

The less string handling code in C we have to maintain, the better.
@MichalStrehovsky
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks!

@MichalStrehovsky MichalStrehovsky merged commit f924653 into dotnet:main May 31, 2023
@MichalStrehovsky MichalStrehovsky deleted the appcontext branch May 31, 2023 09:34
@ghost ghost locked as resolved and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NativeAOT: Custom runtime without AppContext class throw
2 participants