-
Notifications
You must be signed in to change notification settings - Fork 154
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
perf: Reduce loops in when clean queue in BroadcastHub #1628
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
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