-
Notifications
You must be signed in to change notification settings - Fork 628
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
Fix SplitSink performance problem #1969
Fix SplitSink performance problem #1969
Conversation
It looks like both |
ready!(inner.as_pin_mut().poll_ready(cx))?; | ||
inner.as_pin_mut().start_send(this.slot.take().unwrap())?; | ||
} | ||
ready!(Self::poll_flush_slot(inner.as_pin_mut(), &mut this.slot, cx))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the this.lock.poll_lock(cx)
out of poll_flush_slot
to avoid the need to poll_lock
again to get the inner
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, I missed that it needs the lock across both operations.
Please take a look. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ready!(inner.as_pin_mut().poll_ready(cx))?; | ||
inner.as_pin_mut().start_send(this.slot.take().unwrap())?; | ||
} | ||
ready!(Self::poll_flush_slot(inner.as_pin_mut(), &mut this.slot, cx))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, I missed that it needs the lock across both operations.
Oh, I just merge master to this branch to update it. Shall I revert it and use rebase instead? |
Please refer to the related issue for details.
Maybe I should add tests for this "buffering guarantee"?