[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PATCH: add support for TCP_NODELAY on network streams
From: |
Eric Marsden |
Subject: |
PATCH: add support for TCP_NODELAY on network streams |
Date: |
Wed, 11 Dec 2024 11:51:27 +0100 |
User-agent: |
Mozilla Thunderbird |
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.
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
add-tcp-nodelay.diff
Description: Text Data
- PATCH: add support for TCP_NODELAY on network streams,
Eric Marsden <=