Re: Flushing large data immediately in pqcomm

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Flushing large data immediately in pqcomm
Date: 2024-03-14 13:03:19
Message-ID: CAGECzQT9gH6uUd9pnTC=NB7TSwiTsO3kxYH5BXraSy3549Oe_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 14 Mar 2024 at 13:12, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Thu, Mar 14, 2024 at 7:22 AM Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)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!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-03-14 13:15:56 Re: [PATCH] LockAcquireExtended improvement
Previous Message Peter Eisentraut 2024-03-14 13:02:46 Re: Inconsistent printf placeholders