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

Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)
Date: 2013-01-09 16:57:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2013-01-09 11:37:46 -0500, Tom Lane wrote:
>> I agree that what dirmod is doing is pretty ugly, but it's localized
>> enough that I don't care particularly.  (Really, the only reason it's
>> a hack and not The Solution is that at the moment there's only one
>> file doing it that way.  A trampoline function for use only by code
>> that needs to work in both frontend and backend isn't an unreasonable
>> idea.)

> Well, after the patch the trampoline function would be palloc() itself.

My objection is that you're forcing *all* backend code to go through
the trampoline.  That probably has a negative impact on performance, and
if you think it'll get committed without a thorough proof that there's
no such impact, you're mistaken.  Perhaps you're not aware of exactly
how hot a hot-spot palloc is?  It's not unlikely that this patch could
hurt backend performance by several percent all by itself.

Now on the other side of the coin, it's also possible that it's a wash,
particularly on machines where fetching a global variable is a
relatively expensive thing to do.  But the driving force behind any
proposed change to the backend's palloc mechanism has to be performance,
and nothing but.  Convenience for a patch such as this not only doesn't
trump performance, I'm unwilling to grant it any standing at all.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2013-01-09 16:58:29
Subject: Re: Event Triggers: adding information
Previous:From: Andres FreundDate: 2013-01-09 16:56:50
Subject: Re: [PATCH 1/2] Provide a common malloc wrappers and palloc et al. emulation for frontend'ish environs

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