Tags: ferd/pobox
Tags
Using Size when dropping items POBox tracks the size of all the entries it has for quick matching to know when a buffer is full or not. However, it does *not* make use of that data when dropping more than 1 element (either in drop or push_drop) and instead recalculates the buffer size dynamically (O(n)). This behaviour can make it so busy buffers that need to drop data continuously because they're full end up doing a lot more work than nearly-empty buffers, which is counter-productive (they should all be doing nearly no work at all). This patch makes it so that the size is explicitly passed to the drop functions of the module, bringing that length check to a no-cost operation.