Enumeration

compression_algorithm

A structure for values that represent compression algorithms.

Declaration

typedef enum : unsigned int {
    ...
} compression_algorithm;

Overview

Choose an algorithm according to the following guidelines:

  • If speed and compression ratio are important, use COMPRESSION_LZFSE. If you require interoperability with non-Apple devices, use COMPRESSION_ZLIB.

  • Use COMPRESSION_LZ4 if speed is critical, and you are willing to sacrifice compression ratio to achieve it.

  • Use COMPRESSION_LZMA if compression ratio is critical, and you are willing to sacrifice speed to achieve it. Note that COMPRESSION_LZMA is an order of magnitude slower for both compression and decompression than other choices.

COMPRESSION_LZFSE is faster than COMPRESSION_ZLIB, and generally achieves a better compression ratio. However, it is slower than COMPRESSION_LZ4 and does not compress as well as COMPRESSION_LZMA, so you will still want to use COMPRESSION_LZ4 if speed is critical or COMPRESSION_LZMA if compression ratio is critical.

Topics

Algorithm Constants

COMPRESSION_LZFSE

The LZFSE compression algorithm, that is recommended for use on Apple platforms.

COMPRESSION_LZ4

The LZ4 compression algorithm, that is recommended for fast compression.

COMPRESSION_LZ4_RAW

The LZ4 compression algorithm, without frame headers.

COMPRESSION_LZMA

The LZMA compression algorithm, that is recommended for high-compression ratio.

COMPRESSION_ZLIB

The zlib compression algorithm, that is recommended for cross-platform compression.