lz4rip (repo) is a Rust LZ4 block and frame codec, derived from lz4_flex. Faster compression through aggressive skip acceleration and generational hash tables, with first-class dictionary support.
v0.2.0 just released. Perf improved on aarch64. Overall beating C LZ4 with safe Rust!
Hey, what's the third-party dep story? Are you dragging in a ton of external deps, or no? What's the testing story? Super cool. I've wanted to explore it for a long time but just haven't been able to find the time.
One optional dependency: twox-hash (xxHash32 only), for checksums in the frame format. Block codec has zero deps.
~100 tests (unit + integration + doctests), 10 fuzz targets under cargo-fuzz (round-trips, corrupt input, cross-validation against C lz4). Beyond that I do a lot of end-to-end perf testing in OMQ.rs, measuring compress+send+decompress latency over PUSH/PULL TCP with and without dictionary compression.
For inputs under 64 KB (the common case for message transports), the hash table is 4K×u16 = 8 KB, small enough to fit in L1d and leave room for application data alongside it. Trades some ratio for speed and makes the compressor practical to embed in a hot loop.
The sweep chart below shows the tradeoffs across input sizes. lz4rip is tuned to favor speed on small messages at the cost of some ratio on large inputs, and all the hot paths (compress, decompress, frame, sink) are #[forbid(unsafe_code)].
And finally, the compression chart from OMQ.rs itself (it auto-trains a dict on the first 100 small messages and ships it to peers once):
To me, it's mind-blowing. I've been dreaming of ZMQ with a compression transport for at least 10 years.