Re: Cleaning up and speeding up string functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Cleaning up and speeding up string functions
Дата
Msg-id 31536.1558803042@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Cleaning up and speeding up string functions  (David Rowley <david.rowley@2ndquadrant.com>)
Ответы Re: Cleaning up and speeding up string functions  (David Rowley <david.rowley@2ndquadrant.com>)
Re: Cleaning up and speeding up string functions  (David Rowley <david.rowley@2ndquadrant.com>)
Список pgsql-hackers
David Rowley <david.rowley@2ndquadrant.com> writes:
> Here's a small patch series aimed to both clean up a few misuses of
> string functions and also to optimise a few things along the way.

> 0001: Converts various call that use appendPQExpBuffer() that really
> should use appendPQExrBufferStr().  If there's no formatting then
> using the former function is a waste of effort.

> 0002: Similar to 0001 but replaces various appendStringInfo calls with
> appendStringInfoString calls.

Agreed on these; we've applied such transformations before.

> 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.

> 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.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: POC: converting Lists into arrays
Следующее
От: Alexander Lakhin
Дата:
Сообщение: Fix inconsistencies for v12