From dev-return-203672-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Fri Nov 22 15:25:49 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8490E180629 for ; Fri, 22 Nov 2019 16:25:49 +0100 (CET) Received: (qmail 45332 invoked by uid 500); 22 Nov 2019 15:25:48 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 45322 invoked by uid 99); 22 Nov 2019 15:25:48 -0000 Received: from Unknown (HELO mailrelay1-lw-us.apache.org) (10.10.3.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Nov 2019 15:25:48 +0000 Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id 0D3441003 for ; Fri, 22 Nov 2019 15:25:48 +0000 (UTC) Received: by mail-yb1-f173.google.com with SMTP id y18so2802545ybs.7 for ; Fri, 22 Nov 2019 07:25:48 -0800 (PST) X-Gm-Message-State: APjAAAWZAvDQKSIMati46bawOhUjkdYMjQfqtGlBBiQEVYaItrqUbpv9 OcvLqfHrL+OId6IMhOANUCJyLtB2Q88mJ7+lFf4= X-Google-Smtp-Source: APXvYqy9LdrSMN/M/IrmC0g1n1zfG0u0ClLWxAmN3YP+JQ2oIxgIlxBr1nIjpqv3seC5g3cemgLTGs90Zla0jDwdIBI= X-Received: by 2002:a25:ab41:: with SMTP id u59mr11610541ybi.339.1574436347642; Fri, 22 Nov 2019 07:25:47 -0800 (PST) MIME-Version: 1.0 From: =?UTF-8?Q?R=C3=A9my_Maucherat?= Date: Fri, 22 Nov 2019 16:25:36 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Drop SocketWrapperBase.write(Non)BlockingDirect methods To: Tomcat Developers List Content-Type: multipart/alternative; boundary="00000000000039095f0597f107e6" --00000000000039095f0597f107e6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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). R=C3=A9my --00000000000039095f0597f107e6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I'm looking at the e= ndpoint 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 thi= nking 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" wr= ites (where the caller owns the buffer that is ultimately written to the so= cket 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 consideri= ng removing them (quick experiment: no particular problem with the testsuit= e).

R=C3=A9my

--00000000000039095f0597f107e6--