Re: Flushing large data immediately in pqcomm
Jelte Fennema-Nio <postgres@jeltef.nl>
From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Melih Mutlu <m.melihmutlu@gmail.com>, Andres Freund <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Heikki Linnakangas <hlinnaka@iki.fi>, Thomas Munro <thomas.munro@gmail.com>
Date: 2024-03-14T13:03:19Z
Lists: pgsql-hackers
On Thu, 14 Mar 2024 at 13:12, Robert Haas <robertmhaas@gmail.com> wrote: > > On Thu, Mar 14, 2024 at 7:22 AM Melih Mutlu <m.melihmutlu@gmail.com> wrote: > > 1- Even though I expect both the patch and HEAD behave similarly in case of small data (case 1: 100 bytes), the patch runs slightly slower than HEAD. > > I wonder why this happens. It seems like maybe something that could be fixed. some wild guesses: 1. maybe it's the extra call overhead of the new internal_flush implementation. What happens if you make that an inline function? 2. maybe swap these conditions around (the call seems heavier than a simple comparison): !pq_is_send_pending() && len >= PqSendBufferSize BTW, the improvements for the larger rows are awesome!
Commits
-
Avoid needless large memcpys in libpq socket writing
- c4ab7da60617 17.0 landed