1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

lib/tsocket: add a fast path to tsocket_sendto_send/recv()

By first trying to send data without waiting for the socket
to become writeable we gain about 10-20% performance in the
LDAP-BENCH-CLDAP test.

metze
This commit is contained in:
Stefan Metzmacher 2009-03-11 17:11:22 +01:00
parent 235a7a420b
commit b900e92425

View File

@ -75,6 +75,16 @@ struct tevent_req *tsocket_sendto_send(struct tsocket_context *sock,
state->caller.dst = dst;
state->ret = -1;
/*
* this is a fast path, not waiting for the
* socket to become explicit writeable gains
* about 10%-20% performance in benchmark tests.
*/
tsocket_sendto_handler(sock, req);
if (!tevent_req_is_in_progress(req)) {
goto post;
}
talloc_set_destructor(state, tsocket_sendto_state_destructor);
ret = tsocket_set_writeable_handler(sock,