Skip site navigation (1) Skip section navigation (2)

Re: FunctionCallN improvement.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: a_ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp>,pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FunctionCallN improvement.
Date: 2005-02-01 01:09:01
Message-ID: 8351.1107220141@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Neil Conway <neilc(at)samurai(dot)com> writes:
> On Mon, 2005-01-31 at 23:38 +0900, a_ogawa wrote:
>> (b)Define the macro that initialize FunctionCallInfoData, and use it 
>> instead of MemSet in all FunctionCallN, DirectFunctionCallN, 
>> OidFunctionCallN.
>> This macro is the following. 
>> 
>> #define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs)     \
>> do {                                                    \
>> (Fcinfo)->flinfo = Flinfo;                          \
>> (Fcinfo)->context = NULL;                           \
>> (Fcinfo)->resultinfo = NULL;                        \
>> (Fcinfo)->isnull = false;                           \
>> (Fcinfo)->nargs = Nargs;                            \
>> MemSet((Fcinfo)->argnull, 0, Nargs * sizeof(bool)); \
>> } while(0)
>> 
>> I think that plan(b) is better, because source code consistency 
>> and efficiency improve.

> I agree; I think the macro is a nice improvement to readability.

But a dead loss for performance, since it does a MemSet *and* some other
operations.  What's worse, it changes a word-aligned MemSet into a
non-aligned one, knocking out all the optimizations therein.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Michael FuhrDate: 2005-02-01 01:38:55
Subject: Re: Last ID Problem
Previous:From: Mitch PirtleDate: 2005-02-01 00:58:42
Subject: Re: Last ID Problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group