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

[chore] Fix MergeSplit logic, update tests to use Request #12170

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Jan 23, 2025

No need for a changelog since the cache items was added this release.

Depends on #12169

@bogdandrutu bogdandrutu requested review from dmitryax and a team as code owners January 23, 2025 07:49
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.82%. Comparing base (ad36545) to head (7e52446).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12170      +/-   ##
==========================================
- Coverage   91.82%   91.82%   -0.01%     
==========================================
  Files         463      463              
  Lines       24776    24773       -3     
==========================================
- Hits        22750    22747       -3     
  Misses       1644     1644              
  Partials      382      382              

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

Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

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

Can we eliminate cached item counts? I wonder if it's a premature optimization.

Comment on lines +27 to +28
req.setCachedItemsCount(req.ItemsCount() + req2.ItemsCount())
req2.setCachedItemsCount(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes me wonder what the real benefit of having a cached items count is? How many times do we expect that value to be read, aside from once by the observability sender?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Joshua! This optimization comes from the observation that ItemsCount() is repeatedly called during merge-splitting and is a fairly expensive operation. The optimization has proved to save 30 - 75% cpu time for merging based on the benchmark (see more details in #12136)

I understand your concern around having an additional variable to book-keep could be error-prone, but I would argue that no one, except for the batcher, should be messing around with the request once its created. We just need to make sure that the cached items count is updated when the wrapped proto is updated.

@bogdandrutu
Copy link
Member Author

Can we eliminate cached item counts? I wonder if it's a premature optimization.

I would prefer not to #12136

@bogdandrutu bogdandrutu added this pull request to the merge queue Jan 23, 2025
Merged via the queue into open-telemetry:main with commit bc7e464 Jan 23, 2025
53 checks passed
@bogdandrutu bogdandrutu deleted the fix_signals_request branch January 23, 2025 18:36
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.

4 participants