summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-03-11 17:27:03 +0100
committerStefan Metzmacher <metze@samba.org>2009-03-19 16:25:57 +0100
commitf6efec5dd423b54f6b9b8cf8d47e644481b0aea2 (patch)
tree74f6ab1ed8f0e4b4435ea7d57fe9374abb428d72
parentb900e9242512e35f7f805ba4f4ce1624c2677d8b (diff)
downloadsamba-f6efec5dd423b54f6b9b8cf8d47e644481b0aea2.tar.gz
samba-f6efec5dd423b54f6b9b8cf8d47e644481b0aea2.tar.bz2
samba-f6efec5dd423b54f6b9b8cf8d47e644481b0aea2.zip
lib/tsocket: add a fast path to tsocket_writev_send/recv()
This is similar to the tsocket_sendto_send/recv() fast path. metze
-rw-r--r--lib/tsocket/tsocket_writev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tsocket/tsocket_writev.c b/lib/tsocket/tsocket_writev.c
index 27f28a60e4..8c5cd40385 100644
--- a/lib/tsocket/tsocket_writev.c
+++ b/lib/tsocket/tsocket_writev.c
@@ -103,6 +103,16 @@ struct tevent_req *tsocket_writev_send(struct tsocket_context *sock,
goto post;
}
+ /*
+ * this is a fast path, not waiting for the
+ * socket to become explicit writeable gains
+ * about 10%-20% performance in benchmark tests.
+ */
+ tsocket_writev_handler(sock, req);
+ if (!tevent_req_is_in_progress(req)) {
+ goto post;
+ }
+
talloc_set_destructor(state, tsocket_writev_state_destructor);
ret = tsocket_set_writeable_handler(sock,