pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ilmari@ilmari.org
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Rethinking MemoryContext creation
Date: Mon, 11 Dec 2017 17:39:48 +0000
Message-ID: <d8jwp1txixn.fsf@dalvik.ping.uio.no> (raw)
In-Reply-To: <CA+TgmoY6czPPXdE+Y8R+S5e6xxG32rciuDfmkivg1dpB0bJSKw@mail.gmail.com>
References: <2264.1512870796@sss.pgh.pa.us>
	<9726.1513009650@sss.pgh.pa.us>
	<f49b797a-5c92-156a-e624-897a6045d9cc@2ndquadrant.com>
	<12544.1513011559@sss.pgh.pa.us>
	<CA+TgmoY6czPPXdE+Y8R+S5e6xxG32rciuDfmkivg1dpB0bJSKw@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:

> On Mon, Dec 11, 2017 at 11:59 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
>>> On 12/11/2017 05:27 PM, Tom Lane wrote:
>>>> However, unless we want to run around and touch all the ~ 150 calls
>>>> with constant arguments, we'd have to set things up so that the default
>>>> behavior for AllocSetContextCreate is to not copy.  This risks breaking
>>>> callers in extensions.  Not entirely sure if it's worth that --- any
>>>> thoughts?
>>
>>> I don't think silently breaking extensions is particularly attractive
>>> option, so I guess we'll have to run around and tweak the ~150 calls.
>>
>> Meh.  I suppose that of the ~150 call sites, there are probably only
>> a dozen or two where it would actually make a performance difference,
>> so maybe this needn't be quite as invasive as I first thought.
>
> I think changing only a subset of the call sites is unappealing
> because, even though it may not make a measurable performance
> difference in other cases, it may get cargo-culted into some place
> where it does make a difference.

Would it be acceptable to only get this optimisation on compilers that
support __builtin_constant_p or similar?  If so, the wrapper macro could
use that to automatically pass the no-copy flag when called with a
literal string.

- ilmari
-- 
"I use RMS as a guide in the same way that a boat captain would use
 a lighthouse.  It's good to know where it is, but you generally
 don't want to find yourself in the same spot." - Tollef Fog Heen




view thread (23+ messages)  latest in thread

Message-ID: <d8jwp1txixn.fsf@dalvik.ping.uio.no>
Permalink:  ../d8jwp1txixn.fsf@dalvik.ping.uio.no/
Also on:    postgresql.org/message-id/d8jwp1txixn.fsf@dalvik.ping.uio.no

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: ilmari@ilmari.org, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, tomas.vondra@2ndquadrant.com
  Subject: Re: Rethinking MemoryContext creation
  In-Reply-To: <d8jwp1txixn.fsf@dalvik.ping.uio.no>
  References: <2264.1512870796@sss.pgh.pa.us> <9726.1513009650@sss.pgh.pa.us> <f49b797a-5c92-156a-e624-897a6045d9cc@2ndquadrant.com> <12544.1513011559@sss.pgh.pa.us> <CA+TgmoY6czPPXdE+Y8R+S5e6xxG32rciuDfmkivg1dpB0bJSKw@mail.gmail.com> <d8jwp1txixn.fsf@dalvik.ping.uio.no>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox