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

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

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

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