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

test: Modify perf tests to pass event name correctly to avoid string allocation #2762

Merged

Conversation

cijothomas
Copy link
Member

Follow up to #2760

@cijothomas cijothomas requested a review from a team as a code owner March 5, 2025 18:55
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.6%. Comparing base (f013b3d) to head (a150526).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2762   +/-   ##
=====================================
  Coverage   79.6%   79.6%           
=====================================
  Files        123     123           
  Lines      23034   23034           
=====================================
+ Hits       18352   18356    +4     
+ Misses      4682    4678    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lalitb lalitb changed the title tests : Modify perf tests to pass event name correctly to avoid string allocation test: Modify perf tests to pass event name correctly to avoid string allocation Mar 5, 2025
@@ -88,7 +88,7 @@ fn main() {

fn test_log() {
error!(
name = "CheckoutFailed",
name : "CheckoutFailed",
Copy link
Member Author

@cijothomas cijothomas Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case anyone wondering what this is doing - previous "name" was just any attribute, so the string has to copied to new heap memory.
now, name is part of metadata of tracing, and is &static. Otel stores it as event_name, which is static &str, so allocation and copying is gone.

@cijothomas cijothomas merged commit 36cbe8d into open-telemetry:main Mar 5, 2025
23 of 24 checks passed
@cijothomas cijothomas deleted the cijothomas/fixbench-eventname branch March 5, 2025 19:09
| ot_layer_enabled | 167 ns |

Hardware: Apple M4 Pro
Total Number of Cores: 14 (10 performance and 4 efficiency)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be great if you could also add the CPU speed as part of the details.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to find that detail. @lalitb do you know?

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

Successfully merging this pull request may close these issues.

3 participants