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

Avoid string allocations in hot path. #1004

Closed
cijothomas opened this issue Nov 15, 2018 · 0 comments
Closed

Avoid string allocations in hot path. #1004

cijothomas opened this issue Nov 15, 2018 · 0 comments
Assignees
Milestone

Comments

@cijothomas
Copy link
Contributor

The TryGetDataSeries method in Metric class has a validation of dimension name achieving via a util class. The call to this method is quite expensive due to string allocation/conversions in Invariant() method - Invariant($"{nameof(dimensionValues)}[{d}]")

https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/src/Microsoft.ApplicationInsights/Metric.cs#L450

Proposal is to modify code to avoid this computation unless necessary. (neccessary = dimension is invalid, which is not the common case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant