Skip to content

Commit f6fd796

Browse files
ApplyDeferredBranchUpdates: reduce atomics overhead (#19541)
1 parent 3178fda commit f6fd796

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

execution/commitment/commitment.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,9 @@ func ApplyDeferredBranchUpdates(
471471
if err := putBranch(upd.prefix, upd.encoded, upd.prev); err != nil {
472472
return written, err
473473
}
474-
mxTrieBranchesUpdated.Inc()
475474
written++
476475
}
476+
mxTrieBranchesUpdated.AddInt(written)
477477
return written, nil
478478
}
479479

@@ -538,10 +538,9 @@ func ApplyDeferredBranchUpdates(
538538
firstErr = err
539539
continue
540540
}
541-
mxTrieBranchesUpdated.Inc()
542541
written++
543542
}
544-
543+
mxTrieBranchesUpdated.AddInt(written)
545544
return written, firstErr
546545
}
547546

0 commit comments

Comments
 (0)