public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jeroen Vermeulen <[email protected]>
To: [email protected]
Subject: libpq: PQgetCopyData() and allocation overhead
Date: Fri, 10 Feb 2023 00:25:45 +0100
Message-ID: <CA+zULE5AYd+78w7Uu7jN=5N3w-9vsKuK2WrpjkKwS65hyhWfbw@mail.gmail.com> (raw)

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


view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: libpq: PQgetCopyData() and allocation overhead
  In-Reply-To: <CA+zULE5AYd+78w7Uu7jN=5N3w-9vsKuK2WrpjkKwS65hyhWfbw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox