From: Daniele Varrazzo Date: Sat, 26 Mar 2022 00:18:05 +0000 (+0100) Subject: perf: release the GIL in copy-related libpq functions X-Git-Tag: 3.1~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6206c0fbf878ba5d9279ca377d21922ec92c251c;p=thirdparty%2Fpsycopg.git perf: release the GIL in copy-related libpq functions Tests have shown that these functions may do a considerable amount of work, although purely CPU. --- diff --git a/psycopg_c/psycopg_c/pq/libpq.pxd b/psycopg_c/psycopg_c/pq/libpq.pxd index b554ff365..2f69e2fd1 100644 --- a/psycopg_c/psycopg_c/pq/libpq.pxd +++ b/psycopg_c/psycopg_c/pq/libpq.pxd @@ -253,9 +253,9 @@ cdef extern from "libpq-fe.h": PGnotify *PQnotifies(PGconn *conn) nogil # 33.9. Functions Associated with the COPY Command - int PQputCopyData(PGconn *conn, const char *buffer, int nbytes) - int PQputCopyEnd(PGconn *conn, const char *errormsg) - int PQgetCopyData(PGconn *conn, char **buffer, int async) + int PQputCopyData(PGconn *conn, const char *buffer, int nbytes) nogil + int PQputCopyEnd(PGconn *conn, const char *errormsg) nogil + int PQgetCopyData(PGconn *conn, char **buffer, int async) nogil # 33.10. Control Functions void PQtrace(PGconn *conn, FILE *stream);