You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// send schedules persisting state to a stable storage and AFTER that
// sending the message (as part of next Ready message processing).
func (r *raft) send(m pb.Message) {
@@ -545,6 +559,9 @@ func (r *raft) send(m pb.Message) {
// because the safety of such behavior has not been formally verified,
// we err on the side of safety and omit a `&& !m.Reject` condition
// above.
+ if cap(r.msgsAfterAppend) == 0 {+ r.msgsAfterAppend = *msgsAfterAppendPool.Get().(*[]pb.Message)+ }
r.msgsAfterAppend = append(r.msgsAfterAppend, m)
} else {
if m.To == r.id {
There are a few allocations in the hot path, for example
raft/raft.go
Line 548 in 228ee70
which would be nice to pool. One way we could to this is by introducing something like this:
This is discussed a little bit in #14 (comment).
The text was updated successfully, but these errors were encountered: