You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf: Avoid shallow copies of DSC when sample_rate or replay_id are overwritten #4381
For both cases, we allocate a shallow copy of the DynamicSamplingContext instance, and the underlying IReadOnlyDictionary.
Since DynamicSamplingContext is an internal class, we can optimize the implementation details to avoid copy allocations, and instead mutate the internal Dictionary that we create in the .ctor.
Alternatively, we could rewrite or derive a DynamicSamplingContext, and/or introduce something similar like a DynamicSamplingContextBuilder. But since the DynamicSamplingContext is internal this may not be required.
Activity
linear commentedon Jul 23, 2025
NET-389 perf: Avoid shallow copies of DSC when `sample_rate` or `replay_id` are overwritten
chore: Made DynamicSampleContext mutable
perf: Avoid shallow copies of DSC (#4453)