How pgzip compression and decompression work
masterpgzip provides parallelized gzip operations:
- Compression: Splits data into blocks that are compressed in parallel. This is highly effective for large datasets (over 1MB).
- Decompression: Decompresses data ahead of the current reader in a separate goroutine. This acts as a buffer, ensuring that reads from your application are non-blocking if the decompressor can keep up. CRC calculation also runs in a separate goroutine.
Because pgzip produces standard gzip files, you can compress with pgzip and decompress with any standard gzip tool, and vice versa.