Skip to content

Commit

Permalink
perf(p2p): Remove unnecessary atomic read (backport cometbft#2950) (c…
Browse files Browse the repository at this point in the history
…ometbft#2972) (#41)

This PR is a driveby change. We were doing an atomic read here, but this
is unnecessary. Nothing in the codebase modified this variable after
instantiation.

Doesn't really feel changelog worthy, but I can add one if we want. Felt
like a minor code nit<hr>This is an automatic backport of pull request
cometbft#2950 done by [Mergify](https://mergify.com).

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
(cherry picked from commit c1cebed)
  • Loading branch information
czarcas7ic authored and mergify[bot] committed May 3, 2024
1 parent e2fbfce commit 7edf825
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/conn/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (c *MConnection) sendSomePacketMsgs() bool {
// Block until .sendMonitor says we can write.
// Once we're ready we send more than we asked for,
// but amortized it should even out.
c.sendMonitor.Limit(c._maxPacketMsgSize, atomic.LoadInt64(&c.config.SendRate), true)
c.sendMonitor.Limit(c._maxPacketMsgSize, c.config.SendRate, true)

// Now send some PacketMsgs.
for i := 0; i < numBatchPacketMsgs; i++ {
Expand Down

0 comments on commit 7edf825

Please sign in to comment.