]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[OPTIM] ev_sepoll: detect newly created FDs and check them once
authorWilly Tarreau <w@1wt.eu>
Fri, 29 Aug 2008 11:57:30 +0000 (13:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Nov 2008 09:19:07 +0000 (10:19 +0100)
commitcb651251f9afeabc933abef4f34243fefd296101
tree2c16c0f00d88e566fc86168c5f048b718c26e985
parent21e1be8152c906141d7889220f4da6af1bd7923d
[OPTIM] ev_sepoll: detect newly created FDs and check them once

When an accept() creates a new FD, it is already marked as set for
reads. But the task will be woken up without first checking if the
socket could be read.

The speculative I/O gives us a chance to either read the FD if there
are data pending on it, or immediately mark it for poll mode if
nothing is pending.

Simply doing this reduces the number of calls to process_session
from 6 to 5 per session, 2 to 1 calls to process_request, 10% less
calls to epoll_ctl, fd_clr, fd_set, stream_sock_data_update, 20%
less eb32_insert/eb_delete, etc... General performance increase
seems to be around 3%.
src/ev_sepoll.c
src/proto_http.c