cockroach
cockroach copied to clipboard
kvevent: refactor blocking buffer to use chunked linked list
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...)
Closing because this PR is outdated and will be messy to update. Will link the new PR once it's up.