Skip to content

Commit

Permalink
kvflowtokentracker: remove gc of empty token queues
Browse files Browse the repository at this point in the history
This patch removes the deletion of empty `trackedList` to resuse it in
future runs. Based on benchmarks this helps reduce the heap allocations
in the package.

On `kv0/enc=false/nodes=3/cpu=96` heap profiles, this brings it down to
0.1% from the original 0.3% and much lower than the 0.77% of the
previous commit.

Informs cockroachdb#104154.

Release note: None
  • Loading branch information
aadityasondhi committed Sep 21, 2023
1 parent f5bca80 commit a1e761f
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pkg/kv/kvserver/kvflowcontrol/kvflowtokentracker/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ func (dt *Tracker) Untrack(
log.Infof(ctx, "released %s flow control tokens for %d out of %d tracked deductions for pri=%s stream=%s, up to %s; %d tracked deduction(s) remain%s",
tokens, untracked, trackedBefore, pri, dt.stream, upto, len(dt.trackedM[pri].items), remaining)
}
if len(dt.trackedM[pri].items) == 0 {
delete(dt.trackedM, pri)
}

if dt.lowerBound.Less(upto) {
dt.lowerBound = upto
Expand Down

0 comments on commit a1e761f

Please sign in to comment.