![]() Motivation: Channels can read `ChannelOptions.maxMessagesPerRead` times from a socket in each read cycle. They typically re-use the same buffer for each read and rely on it CoWing if necessary. If we read more than once in a cycle then we may CoW the buffer. Instead of reusing one buffer we can reuse a pool of buffers limited by `maxMessagesPerRead` and cycle through each, reducing the chance of CoWing the buffers. Modifications: - Extend `RecvByteBufferAllocator` to provide the size of the next buffer with a default implementation returning `nil`. - Add an recv buffer pool which lazily grows up to a fixed size and attempts to reuse buffers where possible if doing so avoids CoWing. Results: Fewer allocations |
||
---|---|---|
.. | ||
alloc-limits-from-test-output | ||
boxed-existentials.d | ||
generate-bytebuffer-multi-int.sh | ||
git.commit.template | ||
lldb-smoker | ||
make-single-file-spm | ||
malloc-aggregation.d | ||
stackdiff-dtrace.py | ||
update-alloc-limits-to-last-completed-ci-build |