Skip to content

Conversation

@bantonsson
Copy link
Contributor

Changes

Adds a reserve method to Injector to hint at the number of elements that will be added to avoid multiple resize operations of the underlying data structure. Has an empty default implementation.

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)

@bantonsson bantonsson requested a review from a team as a code owner September 19, 2025 07:50
@codecov
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.7%. Comparing base (61f86c7) to head (d23925b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3173   +/-   ##
=====================================
  Coverage   80.7%   80.7%           
=====================================
  Files        126     126           
  Lines      22331   22397   +66     
=====================================
+ Hits       18023   18089   +66     
  Misses      4308    4308           

☔ 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.

@bantonsson bantonsson force-pushed the ban/add-size-hint-to-injector branch 2 times, most recently from dc83a2d to c4c0160 Compare September 19, 2025 12:57
@bantonsson bantonsson changed the title perf: add a resrve method to Injector to avoid repeated resizing perf: add a reserve method to Injector to avoid repeated resizing Sep 19, 2025
@bantonsson bantonsson force-pushed the ban/add-size-hint-to-injector branch 3 times, most recently from 70395e4 to e58150c Compare September 19, 2025 13:51
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.

Nice improvement!

(Were you seeing propagator alloc/resize showing up in profiling in real applications?)

@bantonsson
Copy link
Contributor Author

Yes, it showed up in profiles of an internal service.

@lalitb
Copy link
Member

lalitb commented Oct 6, 2025

@bantonsson - Good to merge once the conflict is resolved.

@bantonsson bantonsson force-pushed the ban/add-size-hint-to-injector branch from eac6e2e to 560dc0b Compare October 7, 2025 09:14
@lalitb lalitb merged commit 5d2a05e into open-telemetry:main Oct 7, 2025
37 of 44 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