cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

kvevent: refactor blocking buffer to use chunked linked list

Open jayshrivastava opened this issue 3 years ago • 1 comments

This change updates kvevent.blockingBuffer to use a chunked linked list instead of a regular linked list. It also updates the benchmark we use to measure performance for this struct. Please see the commit messages for more info.

Results:

name          old time/op    new time/op    delta
MemBuffer-10     377ms ± 1%     511ms ± 0%  +35.54%  (p=0.000 n=8+9)

name          old alloc/op   new alloc/op   delta
MemBuffer-10    33.6MB ± 0%     0.4MB ± 3%  -98.93%  (p=0.000 n=9+10)

name          old allocs/op  new allocs/op  delta
MemBuffer-10       120 ±10%       111 ±11%   -6.86%  (p=0.030 n=10+10)

The chunked implementation writes exactly the same # of events as the old implementation, which is about ~1179330 events.

Fixes: https://github.com/cockroachdb/cockroach/issues/84709 Fixes: https://github.com/cockroachdb/cockroach/issues/84582 (for now...)

jayshrivastava avatar Aug 09 '22 18:08 jayshrivastava

This change is Reviewable

cockroach-teamcity avatar Aug 09 '22 18:08 cockroach-teamcity

Closing because this PR is outdated and will be messy to update. Will link the new PR once it's up.

jayshrivastava avatar Aug 18 '22 20:08 jayshrivastava