Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wJt3q-000NyR-1j for pgsql-hackers@arkaria.postgresql.org; Mon, 04 May 2026 13:10:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wJt3n-007AbS-2o for pgsql-hackers@arkaria.postgresql.org; Mon, 04 May 2026 13:10:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wJt3n-007AbJ-1s for pgsql-hackers@lists.postgresql.org; Mon, 04 May 2026 13:10:07 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wJt3l-00000000SCQ-0SvZ for pgsql-hackers@postgresql.org; Mon, 04 May 2026 13:10:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 644D9ix4185760; Mon, 4 May 2026 09:09:44 -0400 From: Tom Lane To: Andres Freund cc: Andy Fan , David Rowley , pgsql-hackers Subject: Re: Make printtup a bit faster In-reply-to: References: <87wmjzfz0h.fsf@163.com> <87bk1aj2go.fsf@163.com> <877bpk7dyg.fsf@163.com> <117986.1777869518@sss.pgh.pa.us> Comments: In-reply-to Andres Freund message dated "Mon, 04 May 2026 04:26:17 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <185758.1777900184.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 04 May 2026 09:09:44 -0400 Message-ID: <185759.1777900184@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > FWIW, I've experimented fixing this overhead before, and what I did was = to > pass an optional context via the fcinfo, and output / send functions cou= ld use > memory allocated via that optional context object, rather than doing it > allocating in CurrentMemoryContext. For the send functions that looks > reasonably clean, given that it already deals with a stringinfo. For out > functions it's a bit uglier, but still somewhat acceptable. Hmm, yeah, that could be a route to building a new optional API without causing compatibility problems everywhere. regards, tom lane