Cleaning up and speeding up string functions

Поиск
Список
Период
Сортировка
От David Rowley
Тема Cleaning up and speeding up string functions
Дата
Msg-id CAKJS1f9P=M-3ULmPvr8iCno8yvfDViHibJjpriHU8+SXUgeZ=w@mail.gmail.com
обсуждение исходный текст
Ответы Re: Cleaning up and speeding up string functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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.

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.
The length is already known and stored in the StringInfo's len field.
Not sure if this is the best name for this function, but can't think
of a better one right now.

0004: inlines appendStringInfoString so that any callers that pass in
a string constant (most of them) can have the strlen() call optimised
out.

I don't have any benchmarks to show workloads that this improves,
Likely the chances that it'll slow anything down are pretty remote.

I'll park this here until July.

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

Вложения

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Runtime pruning problem
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Fix link for v12