You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a lower threshold for shrinking the ring buffer
Shrink by 50% when the buffer is < 25% occupied. This provides room
for growth after shrinking without having to immediately grow the
ring buffer. For example, if we were to shrink by 50% when the buffer
was < 50% occupied, adding a new item after shrinking would cause the
buffer to grow immediately. If the number of items in the deque oscillates
around 50% occupancy we would end up with accidentally quadratic behavior;
there would be a high chance that each `put` and `get` operation would
cause the ring buffer to be resized.
0 commit comments