postgresql/src/fe_utils
Tom Lane 6e243d81c5 Fix poorly-sized buffers in astreamer compression modules.
astreamer_gzip.c and astreamer_lz4.c left their decompression
output buffers at StringInfo's default allocation, merely 1kB.
This results in a lot of ping-ponging between the decompressor
and the next astreamer filter.  This patch increases these buffer
sizes to 256kB.  In a simple test this had a small but measurable
effect (saving a few percent) on the overall runtime of pg_waldump
for the gzipped-data case; I didn't bother measuring for lz4.

astreamer_zstd.c used ZSTD_DStreamOutSize() to size its
compression output buffer, but the libzstd API says you should use
ZSTD_CStreamOutSize(); ZSTD_DStreamOutSize() is for decompression.
The two functions seem to produce the same value (256kB) here, so
this is just cosmetic, but nonetheless we should play by the rules.

While these issues are old, they don't seem significant enough to
warrant back-patching.

Discussion: https://postgr.es/m/3424809.1774234940@sss.pgh.pa.us
2026-03-24 12:17:12 -04:00
..
.gitignore Move psql's psqlscan.l into src/fe_utils. 2016-03-24 20:28:47 -04:00
archive.c Update copyright for 2026 2026-01-01 13:24:10 -05:00
astreamer_file.c Update copyright for 2026 2026-01-01 13:24:10 -05:00
astreamer_gzip.c Fix poorly-sized buffers in astreamer compression modules. 2026-03-24 12:17:12 -04:00
astreamer_lz4.c Fix poorly-sized buffers in astreamer compression modules. 2026-03-24 12:17:12 -04:00
astreamer_tar.c Remove nonfunctional tar file trailer size check. 2026-03-22 18:13:41 -04:00
astreamer_zstd.c Fix poorly-sized buffers in astreamer compression modules. 2026-03-24 12:17:12 -04:00
cancel.c Update copyright for 2026 2026-01-01 13:24:10 -05:00
conditional.c fe_utils: Sprinkle some pg_malloc_object() and pg_malloc_array() 2026-02-24 12:34:42 +09:00
connect_utils.c Update copyright for 2026 2026-01-01 13:24:10 -05:00
Makefile Update copyright for 2026 2026-01-01 13:24:10 -05:00
mbprint.c Update copyright for 2026 2026-01-01 13:24:10 -05:00
meson.build meson: allow disabling building/installation of static libraries. 2026-02-23 16:45:40 +01:00
option_utils.c pg_dumpall: Fix handling of conflicting options. 2026-03-06 14:00:04 -06:00
parallel_slot.c Update copyright for 2026 2026-01-01 13:24:10 -05:00
print.c fe_utils: Sprinkle some pg_malloc_object() and pg_malloc_array() 2026-02-24 12:34:42 +09:00
psqlscan.l SQL Property Graph Queries (SQL/PGQ) 2026-03-16 10:14:18 +01:00
query_utils.c Update copyright for 2026 2026-01-01 13:24:10 -05:00
recovery_gen.c Update copyright for 2026 2026-01-01 13:24:10 -05:00
simple_list.c fe_utils: Sprinkle some pg_malloc_object() and pg_malloc_array() 2026-02-24 12:34:42 +09:00
string_utils.c Disallow CR and LF in database, role, and tablespace names 2026-02-23 11:19:13 -05:00
version.c Update copyright for 2026 2026-01-01 13:24:10 -05:00