A fast, portable ANSI C implementation of LZ77 compression optimized for speed over ratio.
FastLZ is a fast, portable implementation of the LZ77 lossless data compression algorithm written in ANSI C. It is designed to compress repetitive data like text or raw pixel data quickly, prioritizing speed over compression ratio. The library is widely used in games, open-source projects, and as a base for other compression tools.
Developers working on performance-critical applications, embedded systems, or projects needing a lightweight, fast compression library with minimal dependencies. It is also suitable for those integrating compression into C/C++ projects or using bindings in other languages.
Developers choose FastLZ for its exceptional speed, portability, and simplicity—it's a single-header library that works across many platforms and architectures. Its focus on fast compression and decompression makes it ideal for real-time data processing where throughput is more important than maximum compression.
Small & portable byte-aligned LZ77 compression
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Compresses at 159 MB/s and decompresses at 305 MB/s on enwik8, significantly outperforming zlib's 50 MB/s compression at level -1, as shown in the README comparison table.
Written in ANSI C/C90 with just two files, it works on any standard-conforming compiler across numerous architectures including x86, ARM, PowerPC, MIPS, and RISC-V, per the extensive CI testing badges.
Can be added directly to projects by including fastlz.h and fastlz.c, with examples like 6pack and 6unpack, and available via package managers like Vcpkg for seamless setup.
Offers official bindings for Rust, Python, JavaScript, Ruby, and Lua, enabling use beyond C/C++ with simple installation from respective package repositories like PyPi or npm.
Achieves only 54.2% compression on enwik8 compared to zlib's 42.3% at level -1, meaning larger output sizes and less efficient storage for the same input data.
Only provides two compression levels (Level 1 and Level 2), with Level 2 documentation incomplete in the README, offering less flexibility than libraries with multiple presets or tunable parameters.
Lacks built-in checksums or error detection mechanisms in the compression layer, requiring developers to implement additional steps for data integrity in compressed blocks.