Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raft: avoid allocation of Raft entry due to logging
`raftpb.Entry.String` takes a pointer receiver, so calling it on a loop variable was causing the variable to escape. Removing the `.String()` call was enough to avoid the allocation, but this also avoids a memory copy and prevents similar bugs. This was responsible for 11.63% of total allocations in an experiment with https://github.com/nvanbenschoten/raft-toy.
- Loading branch information