Live data from Hacker News

Apple Open-Sources its Compression Algorithm LZFSE

infoq.com

11–20 of 219 posts

Re: Apple Open-Sources its Compression Algorithm LZFSE

#13

I just quickly tested it, in terms of highest compression ratio it still does not beat xz, e.g. `tar -cf -FILE | xz -c9e > FILE.tar.xz` https://blog.benmarten.me/2016/04/01/Compress-Files-With-Hig...

That's not a useful comparison. LZFSE is meant to be very fast and energy efficient while xz is meant for high compression while using lots of CPU and memory.

Re: Apple Open-Sources its Compression Algorithm LZFSE

#15

If you want to see some crazy C code, check out this file from the GitHub repo: https://github.com/lzfse/lzfse/blob/master/src/lzvn_encode_b...

Excerpt from the link :

      if (D == D_prev) {
        if (L == 0) {
          *q++ = 0xF0 + (x + 3); // XM!
        } else {
          *q++ = (L >8 in 0..5
        *q++ = (D >> 8) + (L = (1  34) {
        // Long dist
        *q++ = (L > 2) + (L 

Re: Apple Open-Sources its Compression Algorithm LZFSE

#16

I just quickly tested it, in terms of highest compression ratio it still does not beat xz, e.g. `tar -cf -FILE | xz -c9e > FILE.tar.xz` https://blog.benmarten.me/2016/04/01/Compress-Files-With-Hig...

That's not surprising, given that they went for compression and decompression speed and for energy usage.

Their goal seems to have been to be at least as good as zlib at compressing stuff using less energy and doing it faster (that often correlates quite well with energy use on modern CPUs, as it allows them to drop to low energy states faster)

Re: Apple Open-Sources its Compression Algorithm LZFSE

#17
With energy efficiency as a primary goal I was expecting way more use of explicit SIMD instructions.

The InfoQ post mentions xcodebuild, but there is also a Makefile. I really appreciate the presence of a no-nonsense Makefile. No autoconf, no pkgconfig, just plain and simple make. Also, because nobody mentioned it: yes, it compiles on Linux out of the box.

Re: Apple Open-Sources its Compression Algorithm LZFSE

#18
post #8
post #6

So... basically a clone of LZ4?

Basically an Apple-specific reimplementation of Zstd: https://github.com/Cyan4973/zstd

So, worse than LZ4 for what Apple seems to be using it for. Why didn't they just use LZ4? Confusing company, they are.
Post reply on HN