Re: Faster setup_param_list() in plpgsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Faster setup_param_list() in plpgsql
Date: 2015-07-02 19:44:04
Message-ID: 10845.1435866244@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> What this patch does is to remove setup_param_list() overhead for the
> common case of PLPGSQL_DTYPE_VAR variables (ie, any non-composite type).
> It does that by the expedient of keeping the ParamExternData image of such
> a variable valid at all times. That adds a few cycles to assignments to
> these variables, but removes more cycles from each use of them. Unless
> you believe that common plpgsql functions contain lots of dead stores,
> this is a guaranteed win overall.

> I'm seeing about 10% overall speedup (vs HEAD, with casserts off) for
> realistic simple plpgsql logic, such as this test case:

Here is a version that is rebased up to HEAD. Dunno if anyone wants
to re-review this, if not I'll go commit it.

regards, tom lane

Attachment Content-Type Size
faster-setup_param_list-2.0.patch text/x-diff 44.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-07-02 19:44:58 Re: Support for N synchronous standby servers - take 2
Previous Message David Christensen 2015-07-02 19:39:10 Add checksums without --initdb