Re: inline newNode()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: inline newNode()
Date: 2002-10-09 04:12:12
Message-ID: 16989.1034136732@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> OK, here is a version of newNode that is a macro.

If you use memset() instead of MemSet(), I'm afraid you're going to blow
off most of the performance gain this was supposed to achieve.

> Does anyone have additional suggestions? The only thing I can suggest
> is to make a clear-memory version of palloc because palloc always calls
> MemoryContextAlloc() so I can put it in there. How does that sound?

I do not think palloc should auto-zero memory. Hard to explain why,
but it just feels like a bad decision. One point is that the MemSet
has to be inlined or it cannot compile-out the tests on _len. palloc
can't treat the length as a compile-time constant.

> The regression tests do pass with this patch, so functionally it works
> fine.

Speed is the issue here, not functionality...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-10-09 04:21:41 Re: inline newNode()
Previous Message Justin Clift 2002-10-09 02:19:34 Italian version of the PostgreSQL "Advocacy and Marketing" site is ready

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-10-09 04:21:41 Re: inline newNode()
Previous Message Bruce Momjian 2002-10-09 00:07:30 Re: inline newNode()