On Sat, Nov 23, 2019 at 8:54 PM Mark Thomas <ma...@apache.org> wrote:

> On 22/11/2019 15:25, Rémy Maucherat wrote:
> > Hi,
> >
> > 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).
>
> My only concern would be stability. With careful review we should be
> able to handle that.
>

It looked ok and removed a big chunk of code so I went ahead with it.

As far as porting goes, I have:
- This one, also the easiest one: drop
SocketWrapperBase.write(Non)BlockingDirect methods
- Move the processor tracking to the wrapper and the connection map to the
endpoint; this one can improve performance
- The pile ups of close refactoring; big cleanup and move close to the
wrapper, also improves robustness, I would do it last

If everything is ported, the two branches should be similar and patch
cherry pick should work better for future fixes.

Rémy

Reply via email to