A lightweight CM compressor for prototyping built with zig, roughly based on lpaq.
It gallops!
Currently: prediction is bitwise, model is order0-ish (12-bit context) with simple 12-bit counters.
./gallop c /data/book1 book1.bin
./gallop c book1.bin book1.orig
cmp book1.orig /data/book1
- Compress book1 in <2 s, enwik8 in <3 mins
- Under 1KLoC (but readable, lpaq style)
- Under 1GB memory usage
- Optimized for compression ratio
- Add a magic number (I propose b"gllp" = 0x676c_6c70)
- Use (12-bit) states instead of counters
- Add state map
- Match model?
- Delayed counters?
- Entropy hashing?
zig build-exe gallop.zig
Roughly based on lpaq. Check out my other compressor weath3rb0i.