mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
reds-stream: Small syscall optimisation
Handle single chunk writev as normal write. From some test more than 60% of the times writev is called with 1 as counter. We can easily and very cheaply turn this call to a simpler write avoiding the need to pass the array to the kernel. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
7b5e294a36
commit
186b8439ae
@ -308,7 +308,7 @@ ssize_t reds_stream_writev(RedsStream *s, const struct iovec *iov, int iovcnt)
|
||||
int n;
|
||||
ssize_t ret = 0;
|
||||
|
||||
if (s->priv->writev != NULL) {
|
||||
if (s->priv->writev != NULL && iovcnt > 1) {
|
||||
return s->priv->writev(s, iov, iovcnt);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user