Re: json/jsonb cleanup + FmgrInfo caching - Mailing list pgsql-hackers

From Tom Lane
Subject Re: json/jsonb cleanup + FmgrInfo caching
Date
Msg-id 2461734.1783610532@sss.pgh.pa.us
Whole thread
In response to Re: json/jsonb cleanup + FmgrInfo caching  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: json/jsonb cleanup + FmgrInfo caching
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> 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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: json/jsonb cleanup + FmgrInfo caching
Next
From: Paul A Jungwirth
Date:
Subject: Re: [PATCH] Fix null pointer dereference in PG19