72 karma · joined June 23, 2026
> receives pushback on the specific, objectively nonsensical critique
> "oh so you're saying that LLM computation and human cognition are equivalent? they're glorified calculators that disprove the Jacobian conjecture!!!"
Hilarious critique. If you weren't as mathematically illiterate as you likely are, you would know how general matrix operations are, and how essentially any algorithm (including human cognition) can be implemented using them as an intermediate.
codec decode ratio encode
misa77 -0 5302 MB/s 42.64% 58.7 MB/s
selkie -3 3078 MB/s 39.58% 97.0 MB/s
lzo1x -1 421 MB/s 47.48% 314 MB/s
memcpy 12135 MB/s 100.00% 11952 MB/smisa77 and oodle are both supported in turbobench (see: https://github.com/powturbo/turbobench), so it's easy to compare them.
Results on the silesia corpus on the same Intel setup described in the README, using turbobench:
codec decode ratio encode
misa77 -0 5309 MB/s 42.64% 58.2 MB/s
misa77 -1 4332 MB/s 39.65% 54.5 MB/s
selkie -1 3095 MB/s 43.48% 197 MB/s
selkie -2 3013 MB/s 41.80% 163 MB/s
selkie -3 3081 MB/s 39.58% 95.8 MB/s
selkie -4 3498 MB/s 36.95% 43.3 MB/s
selkie -5 2607 MB/s 33.58% 2.97 MB/s
lz4 2530 MB/s 47.60% 373 MB/s
Note: selkie -4 corresponds to the "Normal" level here.The format, however, might continue to change for some time because I want to push performance even further.
What is the advantage of this? Out-of-order execution (see my decoder's hot loop: https://github.com/welcome-to-the-sunny-side/misa77/blob/3a9...).
In particular, on even moderately compressible data most blocks take the following form:
- 1 token byte + 2 distance bytes
- a somewhat unpredictable number of literal bytes
If these streams are interleaved, then it's harder for the out-of-order core to process the token bytes of several blocks in advance (as the position of the next token byte depends on the unpredictable number of literal bytes in the current block). However, if you separate them (all token bytes in a prefix, and literal bytes in a suffix), the CPU can speculatively parse token bytes of a lot of blocks in advance (as most of the time, it just has to step forward by three bytes to go to the next block's token byte).I haven't implemented any ARM-specific dispatch yet (there are currently no NEON paths for vector ops either, and we instead trust the compiler to autovectorize), and will do so for upcoming versions.
Some concrete changes in the format are:
- match length per block is capped to 32
- distance to a match must be >= a fixed constant
- unlike lz4, tokens and literals have separate streams
- format of the token byte has been changed
Now, this format allows our decompressor's hot loop to be very simple (in terms of the number of branches it has). This simplicity in turn allows our compressor to create a compressed stream that is friendly to the (small number of) branches in the decompressor.The experimental compression modes (see readme) attempt to exploit this even further (but are even slower at compression). I define a "cost", which is a linear function of the branches induced by a compressed stream (this function serves as a proxy for decompression time), and then do a DP to minimise this cost.
For reference, to test ARM64, I tested v0.1.0 on an M3 mac with this fork of lzbench: https://github.com/welcome-to-the-sunny-side/lzbench/tree/ad...
Here, lz4's decompression speed was far slower than misa77 and zxc. Results are here: https://github.com/welcome-to-the-sunny-side/misa77/blob/mai...
misa77 primarily targets textual data (ie. byte-aligned data formats where each byte corresponds to a symbol), so I hadn't tested it on game assets much until now.
After seeing your comment, I pulled some random assets from Pathfinder WoTR (in fact, Unity compresses them with lz4hc) and DOS2. The gains are much more modest here due to asset data being mostly floats, but level 0 performs decently nevertheless.
Results on a map asset (WoTR):
codec decode ratio encode
misa77 -0 4061 MB/s 61.52% 40.4 MB/s
misa77 -1 2851 MB/s 59.04% 36.2 MB/s
lz4 2561 MB/s 62.66% 488 MB/s
lz4hc -12 2428 MB/s 55.53% 6.23 MB/s
Results on equipment asset (WoTR): codec decode ratio encode
misa77 -0 4675 MB/s 54.33% 48.6 MB/s
misa77 -1 3752 MB/s 51.96% 40.9 MB/s
lz4 3101 MB/s 55.21% 497 MB/s
lz4hc -12 3036 MB/s 47.62% 6.25 MB/s
Results on texture asset (DOS2): codec decode ratio encode
misa77 -0 5546 MB/s 67.99% 47.0 MB/s
misa77 -1 2991 MB/s 63.79% 31.5 MB/s
lz4 3602 MB/s 68.53% 623 MB/s
lz4hc -12 2689 MB/s 59.30% 9.01 MB/s
Note: the benchmarking setup is identical to the intel x86-64 one described in the readme.In short, my decompressor is very simple, and a naive safe version of the decompressor is only about 5% slower than the current unsafe one (and I will add this safe version in v0.3.0).
As for the raw throughput numbers being low here, it's because Intel Turbo (frequency boost) was disabled for stability, and the CPU was running at a fixed frequency of 2.1 GHz (I've confirmed that the relative performance scales similarly even with Turbo enabled).
https://github.com/welcome-to-the-sunny-side/misa77/blob/777...