[metrics] Optimize lookup costs using .NET 9 alternative lookup #5777
Labels
enhancement
New feature or request
metrics
Metrics signal related
needs-runtime-change
Issues which likely require changes from dotnet runtime - typically DiagnosticSource package
perf
Performance related
Milestone
Metrics hot path now involves copying the incoming ReadOnlySpan into a Thread-Local array to do the dictionary lookup. With the new capability to lookup Dictionary with just ReadOnlySpan, we can avoid the thread-local copy cost. Opening an issue to track this.
Unrelated/Related : Rust's Dictionary(hashmap) already allowed such lookups, and I leveraged that in OTel Rust metrics and avoided entire copy costs and got good per gains (open-telemetry/opentelemetry-rust#1989).
The text was updated successfully, but these errors were encountered: