swift-nio/docker
George Barnett 4dfae01cc6
Add a pooled recv buffer allocator (#2362)
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
2023-02-20 17:00:19 +00:00
..
Dockerfile Raise minimum supported Swift version from 5.4 to 5.5 (#2267) 2022-09-29 11:47:44 +01:00
docker-compose.2004.55.yaml Add a pooled recv buffer allocator (#2362) 2023-02-20 17:00:19 +00:00
docker-compose.2004.56.yaml Add a pooled recv buffer allocator (#2362) 2023-02-20 17:00:19 +00:00
docker-compose.2204.57.yaml Add a pooled recv buffer allocator (#2362) 2023-02-20 17:00:19 +00:00
docker-compose.2204.58.yaml Add a pooled recv buffer allocator (#2362) 2023-02-20 17:00:19 +00:00
docker-compose.2204.main.yaml Add a pooled recv buffer allocator (#2362) 2023-02-20 17:00:19 +00:00
docker-compose.yaml Validate missing imports in CI (#2245) 2022-08-15 10:26:34 -07:00