Re: Inlining comparators as a performance optimisation - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Inlining comparators as a performance optimisation
Date
Msg-id 4E7A0D20.1060709@enterprisedb.com
Whole thread Raw
In response to Re: Inlining comparators as a performance optimisation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Inlining comparators as a performance optimisation
List pgsql-hackers
On 21.09.2011 18:46, Tom Lane wrote:
> Well, we'd have to negotiate what the API ought to be.  What I'm
> envisioning is that datatypes could provide alternate comparison
> functions that are designed to be qsort-callable rather than
> SQL-callable.  As such, they could not have entries in pg_proc, so
> it seems like there's no ready way to represent them in the catalogs.

Quite aside from this qsort-thing, it would be nice to have versions of 
all simple functions that could be called without the FunctionCall 
overhead. So instead of:

FunctionCall2(&flinfo_for_int4pl, 1, 2)

you could do simply

int4pl_fastpath(1,2)

I'm not sure how big an effect this would have, but it seems like it 
could shave some cycles across the system.

We could have an extended version of the PG_FUNCTION_INFO_V1 macro that 
would let you register the fastpath function:

PG_FUNCTION_INFO_V1(int4pl, int4pl_fastpath);

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Inlining comparators as a performance optimisation
Next
From: Andres Freund
Date:
Subject: DECLARE CURSOR must not contain data-modifying statements in WITH