GNU bug report logs - #74793
[PATCH] Add support for TCP_NODELAY on network streams

Previous Next

Package: emacs;

Reported by: Eric Marsden <eric.marsden <at> risk-engineering.org>

Date: Wed, 11 Dec 2024 16:18:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 31.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Marsden <eric.marsden <at> risk-engineering.org>
To: 74793 <at> debbugs.gnu.org
Subject: bug#74793: [PATCH] Add support for TCP_NODELAY on network streams
Date: Wed, 11 Dec 2024 17:17:38 +0100
[Message part 1 (text/plain, inline)]
Hi,

The attached patch adds support for the socket option TCP_NODELAY,
to disable Nagle's algorithm. This means that network segments are
sent as soon as possible, even when they contain little data. This
reduces network latency on the network connection, but can lead to
many small packets being sent.

I have only tested on Linux/AMD64, but support for this socket option
is very widespread. Patch reformatted following feedback from Robert
Pluim and Eli Zaretskii.

My motivation for adding this support is that Emacs is very slow
when connecting to the PostgreSQL database over the network, using
my pg-el library, and is unable to saturate CPU when sending a
stream of messages. It is much faster when using a local Unix
connection and saturates CPU.

With this patch, a test case that takes 911 seconds goes down to
76 seconds (x 12 speedup).

Eric
[net-tcp-nodelay.patch (text/x-patch, attachment)]

This bug report was last modified 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.