-
Notifications
You must be signed in to change notification settings - Fork 701
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
Make messageQueue.msgAndCtxs
a circular buffer
#2433
Conversation
@@ -85,6 +86,7 @@ func NewMessageQueue( | |||
cpuTracker: cpuTracker, | |||
cond: sync.NewCond(&sync.Mutex{}), | |||
nodeToUnprocessedMsgs: make(map[ids.NodeID]int), | |||
msgAndCtxs: buffer.NewUnboundedDeque[*msgAndContext](1 /*=initSize*/), |
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.
We do this in our codebase but I don't understand why... IDEs will usually display the name of the parameter and in this case it's really not needed since we only have one possible parameter
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.
vscode does not put in the name of the parameter (which most of the team uses)
Why this should be merged
We can remove some logic about slice manipulation. Also this should result in fewer slices being allocated.
How this works
[]*msgAndCtx
-->buffer.Deque[*msgAndCtx]
How this was tested
Existing UT