logoalt Hacker News

orlp • today at 10:34 AM • 6 replies • view on HN

I'm also working on a better compression algorithm. It decompresses up to 6x faster than zstd while having roughly the same compression ratio and compression speed. Especially the latter misa77 suffers on, e.g. zstd -2 compresses at 350 MB/s on lzbench on AMD (https://inikep.github.io/lzbench/), while misa77 sits at ~10 MB/s for a similar rate.

My reference implementation is also written in (almost entirely safe) Rust, which I honestly think is a table-stakes requirement for a new compression algorithm anno 2026. With all the recent attacks on insecure compression implementations I think introducing a new compression algorithm written in a memory-unsafe language is a non-starter.

Hoping to have a release-ready version at the end of December, when I have some more time to polish it.


Replies

nonadhocproblem • today at 10:59 AM

The lzbench table is several months old at this point, and only has results for misa77 0.6.0, which didn't have any entropy coded levels. I do agree with the broader point of there not being a fast compression level for misa at the middle of the ratio spectrum for now.

On safety, I'm a bit mixed. I think the format is simple enough right now, that the codebase (especially the decompressor, which compiles to a pretty small .text section, or uses an even smaller asm kernel) can be kept tight enough to avoid the kinds of vulnerabilities that have been popping up in the large codebases of established codecs recently. I've also subjected it to quite a bit of fuzzing and several rounds of review (alongside setting an army of agents loose on it to try and break things, which is how many of the vuls in the other codecs were found).

All the best for your release!

spongebobstoes • today at 2:01 PM

I agree that a C++ repo makes it a non-starter for me. processing untrusted user input with new C++ code is just not wise

I've spent too many years writing C++ to confidently say there is no UB even in code that I painstakingly write and review line by line

with how good AI is at exploiting code, it seems irrational to add another C++ blob to my stack. indeed, I've already reimplemented complex components (a/v decoders) in Rust/Go just for the additional safety

fpoling • today at 1:58 PM

Memory-safety is only part of the issues. What would be nice is to have a proof that basic library routines are correct and the decompression produces the correct results, but such proofs can be made for C code as well.

cheney_2004 • today at 1:28 PM

Do you mind elaborating on the parts of your rust design which are currently “unsafe”. I just want to better understand why these tradeoffs are being made and what the effects are.

➕ show 1 reply
SillyUsername • today at 12:53 PM

Ha this is ironic, I'm also doing the same but going for the hard problems, like compressing lossy using lossless.

It's a fools errand but I've a novel algorithm I had an idea for and wanted to try it out.

It beats zip level 9 by at least 60% on all but two lossless tests, XML and nci, but it's catching up, and doesn't overfit.

So far MP3 compression is typically 0.6 to 4% over zip9, typically it achieves this compression _and_ decompression with around the same or faster performance than zip9.

If it's a success I'll make it open source.

➕ show 1 reply
benjiro29 • today at 12:00 PM

[dead]