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

[Bug] Cache values of AppContext switches #2722

Closed
pmaytak opened this issue Jul 16, 2024 · 0 comments · Fixed by #2724
Closed

[Bug] Cache values of AppContext switches #2722

pmaytak opened this issue Jul 16, 2024 · 0 comments · Fixed by #2724
Assignees

Comments

@pmaytak
Copy link
Contributor

pmaytak commented Jul 16, 2024

AppContext.TryGetSwitch statically caches internally but takes out a lock.
.NET almost always caches these values. They're not expected to change while the process is running unlike normal config.

Currently we don't cache values.

To-do:

  • Update all AppContext.TryGetSwitch to statically cache the value.
  • See if moving all context switches into one class for easier management would be helpful.
  • Run perf tests to compare difference.
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 a pull request may close this issue.

1 participant