Contents

COMPRESSION_LZBITMAP

The LZBITMAP compression algorithm, which is designed to exploit the vector instruction set of current CPUs.

Declaration

var COMPRESSION_LZBITMAP: compression_algorithm { get }

Discussion

LZBITMAP is the Apple compression algorithm designed around the SIMD vector instruction set found on modern CPUs. Its encoding scheme arranges literal and match data so that both encoder and decoder hot loops can advance multiple symbols per vector operation, which delivers substantially higher throughput than scalar LZ-family codecs at comparable compression ratios.

LZBITMAP sits between COMPRESSION_LZ4 and COMPRESSION_LZMESH in the speed-ratio tradeoff. It achieves compression ratios close to COMPRESSION_ZLIB at a lower compression cost. When compression ratio and performance are equally important, prefer COMPRESSION_LZMESH to favor ratio and LZBITMAP to favor decoder performance. If raw encoder speed matters more than ratio, use COMPRESSION_LZ4 instead.

LZBITMAP is available only on Apple devices, so don’t use it for payloads that need to be decoded on non-Apple platforms. For cross-platform interoperability, use COMPRESSION_ZLIB or COMPRESSION_LZ4 instead.

LZBITMAP is available through the buffer API only — compression_encode_buffer(_:_:_:_:_:_:) and compression_decode_buffer(_:_:_:_:_:_:).

See Also

Algorithm Constants