tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rémy Maucherat <>
Subject Drop SocketWrapperBase.write(Non)BlockingDirect methods
Date Fri, 22 Nov 2019 15:25:36 GMT

I'm looking at the endpoint code a lot in preparation for ports to 8.5.

I noticed the write(Non)BlockingDirect methods in particular as they had a
fixme which wondered about the buffering strategy. Given the use, the
thinking seems very legacy optimization oriented, because:
- If the socket buffer is configured as direct, then it is a good idea to
always use it
- The async API is a better API for "direct" writes (where the caller owns
the buffer that is ultimately written to the socket or the SSL engine) with
a clearer contract
- HTTP/2 and websocket don't use them anymore by default, and sendfile also
bypasses them

I have not made a performance study but it's fairly certain the benefit is
zero. As a result, I'm considering removing them (quick experiment: no
particular problem with the testsuite).


View raw message