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

SendBatch: Launch one fewer goroutine #230

Closed
wants to merge 1 commit into from

Conversation

aaronbee
Copy link
Collaborator

@aaronbee aaronbee commented Aug 15, 2023

A small optimization to reduce the number of goroutines launched by SendBatch, while achieving the same parallelism. This is especially nice for SendBatch calls that only need to reach one Region Server, because then 0 additional goroutines need to be launched.

Also, changed fail from a bool + mutex to a uint32 that is atomically set to 1 on failure. This was primarily done to reduce lines of code.

@aaronbee aaronbee requested a review from dethi August 15, 2023 22:29
@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.03% ⚠️

Comparison is base (5800f86) 70.29% compared to head (e692a2f) 70.27%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #230      +/-   ##
==========================================
- Coverage   70.29%   70.27%   -0.03%     
==========================================
  Files          27       27              
  Lines        3720     3724       +4     
==========================================
+ Hits         2615     2617       +2     
- Misses        988      991       +3     
+ Partials      117      116       -1     
Files Changed Coverage Δ
rpc.go 84.81% <100.00%> (-0.19%) ⬇️

... and 1 file with indirect coverage changes

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

rpc.go Show resolved Hide resolved
A small optimization to reduce the number of goroutines launched by
SendBatch, while achieving the same parallelism. This is especially
nice for SendBatch calls that only need to reach one Region Server,
because then 0 additional goroutines need to be launched.
@aaronbee
Copy link
Collaborator Author

I created #232 as an alternative to this PR.

@aaronbee
Copy link
Collaborator Author

Superseded by #232

@aaronbee aaronbee closed this Sep 15, 2023
@aaronbee aaronbee deleted the batchgoroutine branch September 15, 2023 16:48
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.

2 participants