Re: inline newNode()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: inline newNode()
Дата
Msg-id 16989.1034136732@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: inline newNode()  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: inline newNode()
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: inline newNode()