pgsql: Optimize pglz compressor for small inputs.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Optimize pglz compressor for small inputs.
Дата
Msg-id E1UtZ38-0006xD-AF@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Optimize pglz compressor for small inputs.

The pglz compressor has a significant startup cost, because it has to
initialize to zeros the history-tracking hash table. On a 64-bit system, the
hash table was 64kB in size. While clearing memory is pretty fast, for very
short inputs the relative cost of that was quite large.

This patch alleviates that in two ways. First, instead of storing pointers
in the hash table, store 16-bit indexes into the hist_entries array. That
slashes the size of the hash table to 1/2 or 1/4 of the original, depending
on the pointer width. Secondly, adjust the size of the hash table based on
input size. For very small inputs, you don't need a large hash table to
avoid collisions.

Review by Amit Kapila.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/031cc55bbea6b3a6b67c700498a78fb1d4399476

Modified Files
--------------
src/backend/utils/adt/pg_lzcompress.c |   95 +++++++++++++++++++++++----------
1 file changed, 66 insertions(+), 29 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Retry short writes when flushing WAL.
Следующее
От: Bruce Momjian
Дата:
Сообщение: pgsql: Remove undocumented -h (help) option