Contents

compression_algorithm

A structure for values that represent compression algorithms.

Declaration

struct 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.

  • If speed is critical, and you’re willing to sacrifice compression ratio to achieve it, use COMPRESSION_LZ4.

  • If compression ratio is critical, and you’re willing to sacrifice speed to achieve it, use COMPRESSION_LZMA. 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’s slower than COMPRESSION_LZ4 and doesn’t compress as well as COMPRESSION_LZMA.

COMPRESSION_LZBITMAP provides a compression-ratio and performance that’s between COMPRESSION_LZ4 and COMPRESSION_LZFSE. When compression ratio and performance are equally important, use COMPRESSION_LZFSE to favor compression ratio and COMPRESSION_LZBITMAP to favor performance.

Topics

Algorithm Constants

Initializers

Instance Properties

See Also

Multiple-step compression