compress_segment_pooled

Function compress_segment_pooled 

Source
pub fn compress_segment_pooled(data: &Contig, level: i32) -> Result<PackedBlock>
Expand description

Compress a segment using ZSTD at the specified level

Uses thread-local context reuse like C++ AGC’s ZSTD_compressCCtx(). This avoids per-segment context allocation/deallocation overhead.

C++ AGC pattern: ZSTD_CCtx* zstd_cctx = ZSTD_createCCtx(); // once per thread ZSTD_compressCCtx(zstd_cctx, …); // reused for all segments ZSTD_freeCCtx(zstd_cctx); // at thread exit

This implementation follows the same pattern using thread_local.