Re: Cleaning up and speeding up string functions

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Cleaning up and speeding up string functions
Дата
Msg-id CAKJS1f9vSN0tM-7Q2=pXX5vgY8mOPkuT9Enu01_SL2wdipH+gw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Cleaning up and speeding up string functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Cleaning up and speeding up string functions  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On Sun, 26 May 2019 at 04:50, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> David Rowley <david.rowley@2ndquadrant.com> writes:
> > 0003: Adds a new function named appendStringInfoStringInfo() which
> > appends one StringInfo onto another.  Various places did this using
> > appendStringInfoString(), but that required a needless strlen() call.
>
> I can't get excited about this one unless you can point to places
> where the savings is meaningful.  Otherwise it's just adding mental
> burden.

The original idea was just to use appendBinaryStringInfo and make use
of the StringInfo's len field. Peter mentioned he'd rather seen a
wrapper function here [1].

> > 0004: inlines appendStringInfoString so that any callers that pass in
> > a string constant (most of them) can have the strlen() call optimised
> > out.
>
> Here the cost is code space rather than programmer-visible complexity,
> but I still doubt that it's worth it.

I see on today's master the postgres binary did grow from 8633960
bytes to 8642504 on my machine using GCC 8.3, so you might be right.
pg_receivewal grew from 96376 to 96424 bytes.

[1] https://www.postgresql.org/message-id/5567B7F5.7050705%40gmx.net


-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Alexander Lakhin
Дата:
Сообщение: Fix inconsistencies for v12
Следующее
От: Jaime Casanova
Дата:
Сообщение: Re: This seems like very unfriendly behaviour