git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: d3b5775) | patch
Unify buffer sizes in pg_dump compression API
2023年3月23日 16:52:32 +0000 (17:52 +0100)
2023年3月23日 16:55:52 +0000 (17:55 +0100)
commit f081a48f9a91a245054e94926e2092bd7e85edff
Unify buffer sizes in pg_dump compression API

Prior to the introduction of the compression API in e9960732a9, pg_dump
would use the ZLIB_IN_SIZE/ZLIB_OUT_SIZE to size input/output buffers.
Commit 0da243fed0 introduced similar constants for LZ4, but while gzip
defined both buffers to be 4kB, LZ4 used 4kB and 16kB without any clear
reasoning why that's desirable.

Furthermore, parts of the code unaware of which compression is used
(e.g. pg_backup_directory.c) continued to use ZLIB_OUT_SIZE directly.

Simplify by replacing the various constants with DEFAULT_IO_BUFFER_SIZE,
set to 4kB. The compression implementations still have an option to use
a custom value, but considering 4kB was fine for 20+ years, I find that
unlikely (and we'd probably just increase the default buffer size).

Author: Georgios Kokolatos
Reviewed-by: Tomas Vondra, Justin Pryzby
Discussion: https://postgr.es/m/33496f7c-3449-1426-d568-63f6bca2ac1f@gmail.com
src/bin/pg_dump/compress_gzip.c diff | blob | blame | history
src/bin/pg_dump/compress_io.h diff | blob | blame | history
src/bin/pg_dump/compress_lz4.c diff | blob | blame | history
src/bin/pg_dump/compress_none.c diff | blob | blame | history
src/bin/pg_dump/pg_backup_directory.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /