github hellobertrand/zxc v0.4.0
ZXC v0.4.0

latest releases: v0.9.1, v0.9.0, v0.8.3...
2 months ago

Version 0.4.0 is bringing major architectural improvements that significantly enhance both compression ratio and decompression speed.

Changes

Optimizations & Core Logic

  • Variable Offset Encoding: Implemented a dynamic encoding scheme using 1-byte offsets for short distances and 2-byte offsets for larger ones, resulting in a more compact bitstream.
  • VByte Decoding: Added multiple optimization paths to accelerate integer decoding: Branchless SWAR (SIMD Within A Register) for generic targets.
  • LZ Match Encoding: Implemented filtering for long-distance matches to prevent inefficient encoding of short matches with large offsets.
  • Double Lazy Matching: Added "Double Lazy" strategy for higher compression levels (L4+), finding deeper and better matches.
  • RLE Optimization: Enhanced both the analysis and encoding/decoding phases for Run-Length Encoding.

File Header Format

  • Before (early versions): Bytes 5-7 are reserved (always 0)
  • After (v0.4.0): Byte 5 = Chunk Size Code (chunk_size / 4096)
    • 0 = Legacy 256KB (backward compatible)
    • 64 = 256KB (default)
  • Impact: Early decoders ignore this field but v0.4.0 decoders require it for proper block allocation

Performance Improvements

  • Throughput Maximization: Delivered global decompression speedups for all levels.
  • Compression Ratio: Optimized compression ratio to shave sizes for all levels.
  • Trade-Off: From level 3 onwards, compression speed decreases to improve the compression ratio. But for levels 1 and 2, the compression speed has been improved.

Download Guide

Build Selection

CPU Generation Linux Windows macOS
x86-64 (2006+) zxc-linux-x86_64.tar.gz zxc-windows-x64.exe.zip -
AVX2 (2013+, Haswell) zxc-linux-x86_64-avx2.tar.gz zxc-windows-x64-avx2.exe.zip -
AVX512 (2017+, Skylake-X) zxc-linux-x86_64-avx512.tar.gz zxc-windows-x64-avx512.exe.zip -
ARM64 zxc-linux-aarch64.tar.gz - zxc-macos-arm64.tar.gz

Unsure? Use the generic x86-64 build for universal compatibility.

CPU Feature Detection (x86)

# Linux
grep -E 'avx512|avx2' /proc/cpuinfo | head -1

# Windows (PowerShell)
Get-WmiObject Win32_Processor | Select-Object Name

Performance

  • x86-64: Baseline (SSE2)
  • AVX2: ~20-30% faster than baseline
  • AVX512: ~40-60% faster than baseline (tested with Intel SDE)

Build from Source

For optimal CPU-specific performance:

git clone https://github.com/hellobertrand/zxc.git
cd zxc && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DZXC_NATIVE_ARCH=ON ..
cmake --build . --parallel

Enables -march=native for maximum SIMD utilization.


Full Changelog: v0.3.3...v0.4.0

Don't miss a new zxc release

NewReleases is sending notifications on new releases.