-
Notifications
You must be signed in to change notification settings - Fork 445
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
Adding noop metrics benchmark #1607
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1607 +/- ##
=====================================
Coverage 67.0% 67.0%
=====================================
Files 138 138
Lines 19515 19515
=====================================
Hits 13084 13084
Misses 6431 6431 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is....interesting. Wondering if it is due to copy or clone or something else inside Key,Value,KeyValue in |
Yes, |
while this got merged, I just noticed that the PR has triggered the CI error in main branch:
The only change was the inclusion of |
Yes please! We need to make sure compiler treat this as a semi-black-box. |
There should not be the any internal copy happening for Key and Value in this specific test. As we are passing string literals for Key and Value, they should just get type-converted to OtelString::Static. The run time memory overhead should be for the vector allocation, which stores the KeyValue objects, which internally refer to the static string liternals. |
Yes I think so too. What is(was) misleading is that, the |
Fixes #
Changes
Adding benchmark for Counter and Vector of KeyValue creation. Rest of the instruments should have benchmarks same as the
counter.
Results:
NoopCounter_NoAttributes: 1.5685 ns
NoopCounter_AddWithInlineStaticAttributes: 15.452 ns
NoopCounter_AddWithStaticArray: 15.354 ns
NoopCounter_AddWithDynamicAttributes: 25.692 ns
CreateVector_KeyValue: 24.515 ns
CreateDynamicVector_StringPair: 117.25 ps
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes