[PATCH] avoid double scanning in function byteain

Поиск
Список
Период
Сортировка
От Steven Niu
Тема [PATCH] avoid double scanning in function byteain
Дата
Msg-id ca315729-140b-426e-81a6-6cd5cfe7ecc5@gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] avoid double scanning in function byteain
Список pgsql-hackers
Hi,

The byteain function converts a string input into a bytea type.
The original implementation processes two input formats:
a hex format (starting with \x) and a traditional escaped format.
For the escaped format, the function scans the input string twice
— once to calculate the exact size of the output and allocate memory,
and again to fill the allocated memory with the parsed data.

This double scanning can be inefficient, especially for large inputs.
So I optimized the function to eliminate the need for two scans,
while preserving correctness and efficiency.

Please help review it and share your valuable comments.

Thanks,
Steven Niu
https://www.highgo.com/
Вложения

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