Phase 6.9.3: zstd compression for cache entries. - encode(): compress data with zstd level 3 (configurable via PDFTRACT_CACHE_ZSTD_LEVEL) - decode(): decompress with 256 MB bomb protection and magic-byte validation - encode_from_reader(): streaming variant for large inputs - decode_into_writer(): streaming variant with incremental bomb protection Acceptance criteria: - Round-trip: encode(decode(bytes)) == bytes (PASS) - Compression ratio: 5 MB -> <= 1.5 MB (PASS, ~4-5x achieved) - Decode of truncated frame -> Err (PASS) - Decode of >256 MB output -> Err (PASS) - Decode of empty input -> Err (PASS) - Decode of non-zstd magic bytes -> Err (PASS) - Benchmark: encode 1 MB < 5 ms (PASS) - Benchmark: decode 1 MB < 2 ms (PASS) See notes/pdftract-2xql8.md for details. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| pdftract-cer-diff | ||
| pdftract-cli | ||
| pdftract-core | ||
| pdftract-py | ||