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