opentelemetry-dotnet
opentelemetry-dotnet copied to clipboard
Reuse dictionaries in `ActivityExtensions`, `MetricItemExtensions` and `OtlpLogExporter`
Fixes #4943
I have to admit I don't know enough of the usage to know if this is really the best option, but it will reduce the number of allocations and dictionary internal growths.
Changes
Tries to use a single instance of a dictionary for ActivityExtensions, MetricItemExtensions and OtlpLogExporter.
Merge requirement checklist
- [x] CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
- [x] Unit tests added/updated
- [x] Appropriate
CHANGELOG.mdfiles updated for non-trivial changes - [x] Changes in public API reviewed (if applicable)
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: paulomorgado / name: Paulo Morgado (f989e01ea83c120c51b8ebe054702d9beed972d0)
@paulomorgado Thanks!. Could you check the benchmarks and share the results here : https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/test/Benchmarks/Exporter so we can see before/after!
@cijothomas,
@paulomorgado Thanks!. Could you check the benchmarks and share the results here : https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/test/Benchmarks/Exporter so we can see before/after!
I've collected the benchmark results. They're a lot.
Are you looking for any particular ones?
@cijothomas,
@paulomorgado Thanks!. Could you check the benchmarks and share the results here : https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/test/Benchmarks/Exporter so we can see before/after!
I've collected the benchmark results. They're a lot.
Are you looking for any particular ones?
Could you share, so it is easy to tell how much we are improving? (also ensures we don't accidentally regress!) Example : https://github.com/open-telemetry/opentelemetry-dotnet/pull/5457#issuecomment-2008107292
There are few OTLPExporter specific benchmarks: https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/test/Benchmarks/Exporter/OtlpTraceExporterBenchmarks.cs
@paulomorgado - Thank you for your time, appreciate the help. As discussed https://github.com/open-telemetry/opentelemetry-dotnet/pull/5727#discussion_r1661310935, I am closing this PR as the implementation is soon going to change.