ZSTD

Synopsis

HELP:   ZSTD data compression technique
TYPE:   OBJECT
SYNTAX: ZSTD(LEVEL=num/FAST/LEV1/LEV2/LEV3/LEV4/LEV5/LEV6/LEV7/LEV8/LEV9/LEV10/LEV11/LEV12/LEV13/LEV14/LEV15/LEV16/LEV17/LEV18/LEV19/LEV20/LEV21/LEV22/BEST/AUTO,SKIP)

Description

The ZSTD compression conforms to the ZSTD-compression tool on UNIX-systems. The compression level can be set to values from 1 to 22, where FAST (1) gives the fastest compression, AUTO (9) provides a balanced default and BEST (19) the maximum compression ratio that is still cheap to read.

AUTO (level 9) is used when no level is specified. If the data is marked as being without redundancy, FAST (level 1) is used instead.

BEST is level 19 and deliberately not the maximum level of the library. Measured with zstd 1.5.7 on text, on a payment-like CSV, on a column of two-byte length fields and on packed numbers, the levels 20, 21 and 22 compress exactly as well as level 19, but the window grows from 8 MiB to 128 MiB. The compressor then needs roughly 705 MiB instead of 81 MiB, and the decompressor - here and at the receiver - needs 128 MiB instead of 8 MiB. The higher levels remain available as LEV20, LEV21 and LEV22 for data that behaves differently.

Decompression of concatenated ZSTD files is also possible. All concatenated files are decompressed into one file. It is also possible to decompress one specific member of this concatenation by specifying the member index of the file to be decompressed:

 filename/:memberindex

If ZSTD compression is used with write.record(), the file attributes cannot be stored in the ZSTD file. The record attributes can be added in front of the record (PRNCTR=RETAIN). By default, a 4 byte length field in little endian is written in front of the data. Such an ZSTD file can be used on record-oriented platforms to recreate the original datasets as PS-VB. You may want to use a ZIP archive or ARMOR encoding to store the file attributes (DCB) to recreate the correct record format and length.

Arguments