Skip to content

Improve immediate measurements#517

Merged
ritchiecarroll merged 2 commits intomasterfrom
ImproveImmediateMeasurements
Apr 23, 2026
Merged

Improve immediate measurements#517
ritchiecarroll merged 2 commits intomasterfrom
ImproveImmediateMeasurements

Conversation

@ritchiecarroll
Copy link
Copy Markdown
Member

Adds HasMeasurementID function to see if immediate measurement cache has desired MeasurementKey

@ritchiecarroll ritchiecarroll deleted the ImproveImmediateMeasurements branch April 23, 2026 15:00
@StephenCWills StephenCWills restored the ImproveImmediateMeasurements branch April 23, 2026 15:02
@StephenCWills StephenCWills reopened this Apr 23, 2026
@ritchiecarroll ritchiecarroll merged commit fad1e57 into master Apr 23, 2026
3 checks passed
@ritchiecarroll ritchiecarroll deleted the ImproveImmediateMeasurements branch April 23, 2026 15:06
@StephenCWills
Copy link
Copy Markdown
Member

FYI, I convinced Ritchie to close the PR, thinking that immediateMeasurements.MeasurementIDs.Contains() would be equivalent to HasMeasurementIDs(), but it turns out that's only true for Dictionary<TKey, TValue>. The ConcurrentDictionary<TKey, TValue> implementation actually creates a copy of the keys as an array and wraps it in a ReadOnlyCollection<TKey>. So in this case, it's much more efficient to use ContainsKey() directly.

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 this pull request may close these issues.

2 participants