pgsql: Improve speed of timestamp/time/date output functions.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Improve speed of timestamp/time/date output functions.
Дата
Msg-id E1aSGhI-0004cN-Hn@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Improve speed of timestamp/time/date output functions.

It seems that sprintf(), at least in glibc's version, is unreasonably slow
compared to hand-rolled code for printing integers.  Replacing most uses of
sprintf() in the datetime.c output functions with special-purpose code
turns out to give more than a 2X speedup in COPY of a table with a single
timestamp column; which is pretty impressive considering all the other
logic in that code path.

David Rowley and Andres Freund, reviewed by Peter Geoghegan and myself

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/aa2387e2fd532954e88dfd8546ab894b9305123d

Modified Files
--------------
src/backend/utils/adt/datetime.c | 389 ++++++++++++++++++++++++++-------------
src/backend/utils/adt/numutils.c | 161 ++++++++++++++++
src/include/utils/builtins.h     |   2 +
3 files changed, 424 insertions(+), 128 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix comment block trashed by pgindent.
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Introduce group locking to prevent parallel processes from deadl