-
Notifications
You must be signed in to change notification settings - Fork 186
perf: Reduce loops when cleaning queue in BroadcastHub #1628
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
Conversation
|
it's better not to change the code in var upToOffset = head
while (consumerWheel(upToOffset & WheelMask).isEmpty) {
upToOffset += 1
unblocked = true
}
if (upToOffset != head) {
cleanQueueInRange(head, upToOffset)
head = upToOffset
} |
|
Can we keep this till v1.2.0? We've had a couple of breaks due to optimisations like this. |
|
I'm not sure if this should be marked as a bug or not. |
| while (head != finalOffset) { | ||
| queue(head & Mask) = null | ||
| head += 1 | ||
| } |
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.
Which can loop many times
pjfanning
left a comment
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
|
@pjfanning I want to backport to 1.1.x too, wdyt |
(cherry picked from commit 9596ea4)
Motivation:
refs: #1627
Modification:
Reduce the loop count
Result:
Reduce the loop count
@andreaslochbihler-da cc as he is the origin reporter