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.
AppContext.TryGetSwitchstatically 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:
AppContext.TryGetSwitchto statically cache the value.