pgsql: Teach convert() and friends to avoid copying when possible.

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема pgsql: Teach convert() and friends to avoid copying when possible.
Дата
Msg-id E1rADBA-008a36-H7@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Teach convert() and friends to avoid copying when possible.

Presently, pg_convert() allocates a new bytea and copies the result
regardless of whether any conversion actually happened.  This
commit adjusts this function to return the source pointer as-is if
no conversion occurred.  This optimization isn't expected to make a
tremendous difference, but it still seems worthwhile to avoid
unnecessary memory allocations.

Author: Yurii Rashkovskii
Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/CA%2BRLCQyknBPSWXRBQGOi6aYEcdQ9RpH9Kch4GjoeY8dQ3D%2Bvhw%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b14b1eb4da4c97afec24cf8956e842b98ebb2a51

Modified Files
--------------
src/backend/utils/mb/mbutils.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Remove now-unnecessary Autovacuum[Launcher|Worker]IAm functions
Следующее
От: Jeff Davis
Дата:
Сообщение: pgsql: Optimize SearchPathCache by saving the last entry.