Re: inline newNode() - Mailing list pgsql-patches

From Tom Lane
Subject Re: inline newNode()
Date
Msg-id 16989.1034136732@sss.pgh.pa.us
Whole thread Raw
In response to Re: inline newNode()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: inline newNode()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: inline newNode()  (Peter Eisentraut <peter_e@gmx.net>)
Re: inline newNode()  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: inline newNode()
Next
From: Bruce Momjian
Date:
Subject: Re: inline newNode()