Re: Why is pq_begintypsend so slow?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Why is pq_begintypsend so slow?
Дата
Msg-id CA+Tgmoa0NkJhTpo8k--joaT=L1kVovK5YozzRjf9eEJdnu5etA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Why is pq_begintypsend so slow?  (Andres Freund <andres@anarazel.de>)
Ответы Re: Why is pq_begintypsend so slow?  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Fri, Jul 31, 2020 at 1:00 PM Andres Freund <andres@anarazel.de> wrote:
> > Perhaps we could add a comment about this, e.g.
> > Marking these pointers with pg_restrict tells the compiler that str
> > and str->data can't overlap, which may allow the compiler to optimize
> > better when this code is inlined. For example, it may be possible to
> > keep str->data in a register across consecutive appendStringInfoString
> > operations.
> >
> > Since pg_restrict is not widely used, I think it's worth adding this
> > kind of annotation, lest other hackers get confused. I'm probably not
> > the only one who isn't on top of this.
>
> Would it make more sense to have a bit of an explanation at
> pg_restrict's definition, instead of having it at (eventually) multiple
> places?

I think, at least for the first few, it might be better to have a more
specific explanation at the point of use, as it may be easier to
understand in specific cases than in general. I imagine this only
really makes sense for places that are pretty hot.

> Ah, I misunderstood. Yea, there's no reason not to do that.

OK, then I vote for that version, as I think it looks nicer.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Why is pq_begintypsend so slow?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [Patch] Optimize dropping of relation buffers using dlist