260 points nonadhocproblem 17 hours ago 85 comments
VeejayRampay 15 hours ago | parent
still, good for the author trying to challenge the status quo and best of luck on the long run.
garganzol 14 hours ago | parent
anonymous908213 13 hours ago | parent
nonadhocproblem 13 hours ago | parent
Someone 13 hours ago | parent
Having said that this repo has fairly extensive tests for that. See https://github.com/welcome-to-the-sunny-side/misa77/blob/mai.... I couldn’t find them covering all settings, but that may be just me not looking hard enough, and even if they don’t, adding that is easy.
nonadhocproblem 13 hours ago | parent
Although relatedly, it's definitely possible for claims on performance (instead of correctness) to only hold on certain classes of data.
nullc 6 hours ago | parent
I dunno, do matching against a hash table and only compare a short fingerprint. It'll be a meaningful speed up, usually be right. Fail in exceptional cases, and lose the performance advantage if you fix it.
CableNinja 10 hours ago | parent
The whole of computing is a shitter of layers and layers of going with what the last guy did. I may or may not use misa77, but i applaud the effort and attempt at innovation.
icauroboros 15 hours ago | parent
nonadhocproblem 14 hours ago | parent
It should still give you LZ4-class ratios with much faster decode than LZ4 though.
user20180120 13 hours ago | parent
Do not do an
apt install lrzip
That will probably give you an older version of lrzip.
Make sure you go and get it from the latest source
orlp 14 hours ago | parent
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.
nonadhocproblem 14 hours ago | parent
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!
SillyUsername 12 hours ago | parent
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.
phacker007 12 hours ago | parent
BorisMelnik 7 hours ago | parent
r_lee 7 hours ago | parent
we will probably see many new approaches come up in the next year where they get combined and mixed and then something comes on top
cheney_2004 12 hours ago | parent
orlp 10 hours ago | parent
1. The hash table for finding matches. This is incredibly important for compression performance, and every lookup has the form TABLE[hash & mask]. The mask guarantees it is in-bounds, but Rust doesn't understand this unless you use a compile-time sized TABLE which is a bunch of duplicate codegen. So I made an unsafe wrapper for it that gets initialized with a capacity and a known-good mask. This is really uncontroversial.
2. The core LZ decompression loop. This is pretty much a worst-case scenario where every single instruction added has a 10-20% performance impact. The LZ loop is a constant chain of the form "copy n bytes from offset i", needs constant bounds checks. We actually do those bounds checks, but amortized (we check e.g. once every 8 iterations that our buffer is large enough for the next 8 iterations, even in the worst case), which due to the dynamic nature of offsets here is not something the compiler understands.
GZGavinZhao 5 hours ago | parent
[0]: https://verus-lang.github.io/verus/guide/ [1]: https://aeneasverif.github.io
fpoling 11 hours ago | parent
knorker 40 minutes ago | parent
But then some package maintainer who does NOT have that pipeline makes just a small change. It's happened many times. Basically impossible to make this mistake with rust because unsafe blocks is not where you'd do these changes. Probably.
spongebobstoes 11 hours ago | parent
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
r_lee 9 hours ago | parent
C++ is a totally fine reference implementation
paaloeye 9 hours ago | parent
uhsiff 4 hours ago | parent
Is Hacker News fake in general?
paaloeye 9 hours ago | parent
Am I holding it wrong???
treyd 9 hours ago | parent
paaloeye 8 hours ago | parent
treyd 8 hours ago | parent
thephyber 1 hour ago | parent
If the programmer restricts themself to the C++ subset considered safe for the Joint Strike Fighter program (the F-35), it should eliminate all of the same classes of memory issues as Rust.
"Use Rust" is heuristic. There are other, equivalent safe heuristics.
pmarreck 9 hours ago | parent
hear, hear.
genxy 3 hours ago | parent
jauntywundrkind 14 hours ago | parent
Zxc has similar compression but very fast. https://github.com/hellobertrand/zxc
Couple others out there too!
nonadhocproblem 14 hours ago | parent
At the higher compression end (levels 11-13), minlz is the most relevant competitor. https://github.com/minio/minlz
andrepd 13 hours ago | parent
Someone 14 hours ago | parent
nonadhocproblem 14 hours ago | parent
atiedebee 13 hours ago | parent
weitendorf 14 hours ago | parent
brotli -11 is so slow nobody probably uses it right now but at 10x speed it actually becomes pretty ok. It's a more efficient encoding than zstd (and gzip by far) at their max compression settings.
Haven't got a writeup yet but: https://claude.ai/share/0e8bf6c0-6d64-4a34-8f97-37ccbae19732
Brotli/zstd are kind of in a class of their own in my view because of their direct browse integration and support. That's why I focused on brotli specifically. Didn't know so many others on hn were also working on this rn.
I actually just did it in x86_64 but if you start there it's trivial to wrap that in C/Go/etc these days. Here's the Go+C shim: https://claude.ai/share/57ddeb9a-36bf-4690-99d5-621147b15a77
vardump 13 hours ago | parent
Compilers are pretty good at optimally scheduling instructions for different CPU architectures, so using assembler directly is counterproductive.
weitendorf 12 hours ago | parent
1. establish a true C impl baseline
2. hillclimb until satisfied
2.5 establish a more rigorous profiling before/after/baseline and hotpath detection approach
3. disassemble and strip out unnecessary binary overhead
4. continue optimizing until satisfied
FOr projects like this where a lot of the iteration is on ASM itself, I do want to challenge one notion though: 1. compilers are pretty good but they are definitely not perfect
2. Fable has pretty good judgment when it comes to handrolled impls, in my opinion
3. hillclimbing performance gains is easily verifiable incrementally on low level code. fablemaxxing asm is basically what this thing was Born To Do
4. past a certain point the tuned asm surpasses the compiler's output every time.
you're basically just throwing world's most expensive/optimized compiler at it over and over and over until you're ready to call it quits. In other words> using assembler directly is counterproductive.
I'm not! ain't nobody got time for that. this like the platonic ideal RL task for models to be trained on and they're better than me at it (at very least much more methodical and persistent)
> for different CPU architectures
Similarly, I don't see why I can't just do this independently on every CPU architecture I care about. I've been doing this kind of stuff a lot the past week and it just works tbh. Here's a 64 bit wasm example, I thought it was pretty interesting: https://claude.ai/share/62d4dae5-3cd5-4108-ad68-5e299a691479
vardump 12 hours ago | parent
It's very easy to just let C-compiler do that work and compile the lib statically + LTO (optionally PGO). You'll get all of the benefits you think you're getting from the assembler version. LTO & PGO might even find more optimizations around the compression / decompression calls.
weitendorf 12 hours ago | parent
I think that over time an increasingly large portion of software will be built this way. For this project I'm ok with adding support for each new CPU taking an agent a few hours. If you're implementing against a known standard, until you find a security issue, these don't really ever need to change, which is a very nice property IMO
ozgrakkurt 9 hours ago | parent
Compiler is actaully not really good at that a lot of the time either.
It is good if you don't want to spend too much time on it, but if you have the time and know how to write assembly then there is no comparison.
fullstop 13 hours ago | parent
weitendorf 12 hours ago | parent
Fortunately fuzzing has become really easy now, but this is a very easy target for an attacker to hit with a adversarial payload because it's not cryptographically secure. It's been pretty hit or miss for me whether I can get regular consumer agents to do "content/binary-aware security testing" on this stuff without freaking out.
But this is itself a climbable problem so, I'm sure it's possible to address this. At a cost of $200 per binary :)
ozgrakkurt 9 hours ago | parent
Is this kind of like OpenSSL being terrible but the crypto libraries being good?
fullstop 8 hours ago | parent
Things like MongoBleed (CVE-2025-14847), are what I am thinking of.
ozgrakkurt 6 hours ago | parent
I think this is the same in crypto as all crypto primitive libraries are ASM/C and they are really solid compared to something like OpenSSL
ozgrakkurt 9 hours ago | parent
jmakov 14 hours ago | parent
prymitive 14 hours ago | parent
Is that really a niche?
poly2it 13 hours ago | parent
nonadhocproblem 13 hours ago | parent
I would publish benchmarks against oodle, but their licensing is quite unclear about whether this is allowed, and I don't want to take risks for no reason.
powturbo 14 hours ago | parent
mis77, zxc, zstd, minlz, ...
TurboBench Compression Benchmark : https://github.com/powturbo/TurboBench
atiedebee 13 hours ago | parent
user20180120 13 hours ago | parent
numericOverflow 13 hours ago | parent
So what is your observed compression speed penalty vs benchmarks? This is understandable, but please show your counterbalance to achieve these decomp benefits.
nonadhocproblem 13 hours ago | parent
I'll post some numbers here anyway. These are on the silesia corpus (text, executables, databases, etc) on the intel setup described in the readme.
Ordered by ratio, encode / decode in MB/s.
ratio encode decode
misa77 -3 42.59% 71.9 5909
misa77 -11 27.38% 33.1 2445
zstd -11 27.35% 26.7 976
zstd -15 26.83% 6.86 997
misa77 -12 25.83% 5.81 2496
zstd -19 24.93% 2.32 870
misa77 -13 24.82% 1.39 2633
zstd -22 24.67% 1.51 813numericOverflow 2 hours ago | parent
iagiagiag 11 hours ago | parent
ramon156 10 hours ago | parent
mgaunard 10 hours ago | parent
Guaranteeing memory safety isn't that useful; guaranteeing correctness is. And no language gives you that.
xeshuman 8 hours ago | parent
59nadir 2 hours ago | parent
rhinoceraptor 3 hours ago | parent
This is like arguing against seatbelts just because guaranteeing survival in a car crash is impossible.
mgaunard 2 hours ago | parent
zX41ZdbW 10 hours ago | parent
nonadhocproblem 9 hours ago | parent
Some of the inefficiencies (for instance, the compressor's allocated state not persisting across calls) are definitely addressable but overall, clickhouse is probably not that great of a fit, as encode speeds matter to it.
The data distribution also isn't the best as I've made several choices that help compress game data better, but hurt here. Performance on textual data (amazon_reviews) looks quite good.
zstd -1 being close on ratio to level 11 at 64 kb is also quite surprising, as in my testing, level 11's ratio is much better on most data (even with 64 kb blocks).
Another thing is the architecture, the gap between misa77 and zstd/zxc is typically widest on x86-64 (linux) and apple silicon, which wasn't tested.
stickler-soz 9 hours ago | parent
nonadhocproblem 8 hours ago | parent
Beating LZ4 is literally the least surprising claim here, and you can reproduce the results yourself through lzbench, turbobench, or even a custom harness. Both of the aforementioned harnesses also publish benchmark results which clearly demonstrate this gap.
- lzbench: https://github.com/inikep/lzbench#benchmarks
- turbobench: https://github.com/powturbo/TurboBench/blob/master/turbobenc...
These speedups are possible by separating command and literal streams and a bunch of other tricks, which allows for better OoO execution. I also reduce branches by reducing maximum match length to 32, and enforcing a minimum match distance of 32 (so we can resolve matches with a single unconditional vector copy).
stickler-soz 7 hours ago | parent
nonadhocproblem 7 hours ago | parent
Closing remarks:
- LZ4 is way slower than memcpy, I don't understand why you're making stuff up lol.
- The clickhouse benchmarks clearly show (on non-silesia data) that misa77 is way faster than LZ4 while attaining similar ratios on most data.
- Selkie is faster than LZ4 and compresses much better on most data.
nukanse 9 hours ago | parent
manlymuppet 9 hours ago | parent
One can always set the preset level in zstd or other similar compressors to high numbers, but the result is usually unusably slow.
nonadhocproblem 9 hours ago | parent
But I would warn that if compression speed matters a lot (if, say, single digit/low tens MB/s isn't acceptable), then misa77 probably isn't the right compressor for you. There are several use cases where these painfully slow compression times are acceptable in exchange for ratio and decode speed, and misa77 targets these. The industry standard for compressing game assets is Oodle, which makes these exact tradeoffs, and misa77 is primarily intended to be a competitor to it.
kobecupens 6 hours ago | parent
muizelaar 4 hours ago | parent
unsigner 3 hours ago | parent
What are you plans to proclaim 1.0?
xpct 3 hours ago | parent