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

perf: Baggage insert & BaggageExt::with_baggage & updated constants to latest standard #2284

Merged
merged 2 commits into from
Mar 2, 2025

Conversation

fraillt
Copy link
Contributor

@fraillt fraillt commented Nov 7, 2024

Changes

Improve few things:

  • BaggageExt::with_baggage now "clone" baggage, instead of iterate+collect.
  • Baggage::insert_with_metadata (used everywhere) should be a bit faster, as it had redundant calculations:
    • access hashmap once (before it was twice)
    • calculate entry content length once (before it was three times, although it's so trivial that probably it's not noticeable anyway)
  • updated incorrect comment on Baggage::iter

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@fraillt fraillt requested a review from a team as a code owner November 7, 2024 08:14
Copy link

linux-foundation-easycla bot commented Nov 7, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@fraillt fraillt force-pushed the baggage-improvements branch from 9c71657 to 66cd5f7 Compare November 7, 2024 08:14
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.4%. Comparing base (5e47487) to head (5201543).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2284   +/-   ##
=====================================
  Coverage   79.4%   79.4%           
=====================================
  Files        123     123           
  Lines      22748   22736   -12     
=====================================
- Hits       18063   18058    -5     
+ Misses      4685    4678    -7     

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

@fraillt fraillt force-pushed the baggage-improvements branch from a20d014 to 8438828 Compare November 13, 2024 18:48
Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

LGTM.
Would be good to add a changelog entry for the fixes in size/length validations fixes.
Will open separate issue to make Baggage spec compliant.

@fraillt fraillt force-pushed the baggage-improvements branch 2 times, most recently from 91eef2f to 5efb903 Compare March 1, 2025 21:13
@fraillt fraillt force-pushed the baggage-improvements branch from 5efb903 to cc7cd67 Compare March 1, 2025 21:19
@fraillt fraillt changed the title Baggage improvements perf: Baggage insert & BaggageExt::with_baggage & updated constants to latest standard Mar 1, 2025
@cijothomas cijothomas merged commit 1583e70 into open-telemetry:main Mar 2, 2025
23 checks passed
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