libpq: PQgetCopyData() and allocation overhead

From: Jeroen Vermeulen <jtvjtv(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: libpq: PQgetCopyData() and allocation overhead
Date: 2023-02-09 23:25:45
Message-ID: CA+zULE5AYd+78w7Uu7jN=5N3w-9vsKuK2WrpjkKwS65hyhWfbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Would there be interest in a variant of PQgetCopyData() that re-uses the
same buffer for a new row, rather than allocating a new buffer on each
iteration?

I tried it on a toy benchmark, and it reduced client-side CPU time by about
12%. (Less of a difference in wall-clock time of course; the client was
only using the CPU for a bit over half the time.)

Jeroen

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2023-02-09 23:34:34 Re: Minor meson gripe
Previous Message Tom Lane 2023-02-09 23:19:06 Re: Importing pg_bsd_indent into our source tree