MEDIUM: h2: perform a single call to the data layer in demux()
authorWilly Tarreau <w@1wt.eu>
Mon, 26 Feb 2018 17:50:57 +0000 (18:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 Jul 2018 17:30:03 +0000 (19:30 +0200)
commit2a761dcf0d81c8c786d172699ef22f577744b5dc
tree7f70e8747c71daf0ac6640cc3be19b2c6cace4a8
parent7999bfbfd3fd02dcc870e58e738897aa7f89bbe5
MEDIUM: h2: perform a single call to the data layer in demux()

Instead of calling the data layer from each individual frame processing
function, we now call it from demux. This requires to know the h2s that
was created inside h2c_frt_handle_headers(), which is why the pointer is
now returned. This results in a small performance boost from 58k to 60k
POST requests/s compared to -master, thanks to half the number of
si_cs_recv_cb() calls and 66% calls to si_cs_wake_cb().

It's interesting to note that all calls to data_cb->recv() are now always
immediately followed by a call to data_cb->wake(). The next step should
be to let the ->wake handler perform the recv() call itself. For this it
will be useful to have some info on the CS to indicate whether or not it
is ready to be read (ie: contains a non-empty input buffer).
src/mux_h2.c