Open viccpp opened 3 years ago
Similar - #2219
How large is each segment?
256 bytes
I've done some performance benchmarks with io vectoring, and it turns out that it is actually cheaper to copy smaller chunks into a larger single memory area than it is to pass around an iovec array, which then also limits the number of messages that can be sent in a single sendmsg() call due to IOV_MAX.
Which is 1024 these days on most platforms.
When using iovecs for the payload we also need to pass at least one extra iovec per message for the message headers.
Please consider adding something like
writev()
to producer functions.In my application I have messages that consist of segments (this allows me to use fast pool allocator). Before calling
produce()
I have to allocate a new buffer for each message and linearize it there. This almost kills all benefits of using memory pool (one-segment messages don't need to be linearized).