public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Robert Haas <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: json/jsonb cleanup + FmgrInfo caching
Date: Thu, 09 Jul 2026 11:22:12 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmoZTQN8oXtB0JiwagG1cAkPOO+gA2+Hnf3w=O5t4ZwOJkA@mail.gmail.com>
References: <CA+TgmoaiothgQrw9OtgsMzBUCnqJ2jdaGTbS6o3fkjCd+LfzWw@mail.gmail.com>
	<CAD5tBc+LK2V6m-BDDD2KUCn3y9zLhO6FsY5VFTRS-+4L5tht3A@mail.gmail.com>
	<CA+TgmoZTQN8oXtB0JiwagG1cAkPOO+gA2+Hnf3w=O5t4ZwOJkA@mail.gmail.com>

Robert Haas <[email protected]> writes:
> Right. I think it is a niche case, but I also don't think this is
> really costing us anything. As far as I can tell from my benchmarking
> to date, fmgr_info() is kind of expensive, but fmgr_info_copy() is
> pretty cheap. So, we could arrange to share a single flinfo for every
> argument of the VARIADIC list, but the savings are pretty limited
> because we wouldn't save fmgr_info() calls, only fmgr_info_copy()
> calls.

The hole in that argument is that fmgr_info_copy() does

	dstinfo->fn_extra = NULL;

so that if the function-to-be-called caches anything in fn_extra,
it will have to populate that cache for each argument.  That could be
quite expensive.  It might still not justify complicating the setup
code, but I don't think it's as clear-cut as you suggest.  Perhaps
some benchmarking is in order.

			regards, tom lane






view thread (4+ 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], [email protected], [email protected]
  Subject: Re: json/jsonb cleanup + FmgrInfo caching
  In-Reply-To: <[email protected]>

* 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