open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/
Apache License 2.0
4.99k stars 1.01k forks source link

Split the set and add attributes benchmarks #5546

Closed dmathieu closed 6 days ago

dmathieu commented 1 week ago

This benchmark currently tests two rather different methods within the same loop, which makes it hard to see what could be causing a performance degradation.

Related: #5054.

BenchmarkSetAddAttributes/SetAttributes-10              14066331                82.80 ns/op           48 B/op          1 allocs/op
BenchmarkSetAddAttributes/AddAttributes-10              19333711               114.7 ns/op             0 B/op          0 allocs/op
codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.2%. Comparing base (cda5094) to head (4983a55).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-go/pull/5546/graphs/tree.svg?width=650&height=150&src=pr&token=8efTmh4kvf&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-go/pull/5546?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #5546 +/- ## ======================================= - Coverage 84.3% 84.2% -0.1% ======================================= Files 269 269 Lines 22021 22021 ======================================= - Hits 18567 18563 -4 - Misses 3126 3130 +4 Partials 328 328 ``` [see 2 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-go/pull/5546/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)