Live data from Hacker News

Bzip3: A spiritual successor to BZip2

github.com

101–110 of 181 posts

Re: Bzip3: A spiritual successor to BZip2

#101
post #4

I've studied the Burrows-Wheeler Transform, I understand the transformation, I've re-implemented it countless times for kicks, I see how it improves compressability, but for the life of me the intuition of _why_ it works has never really clicked. It's a fantastic bit of algorithmic magic that will always impress me to see it.

I really liked the computerphile video about it https://www.youtube.com/watch?v=GYbCttCF25A

Re: Bzip3: A spiritual successor to BZip2

#102
post #97

Earlier quoted context omitted.

The bash 4 thing is due to the GPL 3, not some inherent slowness in updating software. It has nothing to do with zstd, which is permissively licensed.

It doesn't matter why. All that matters is that "current" is not a valid word. Old things exist in "current" systems. And current systems may also be old systems.

Ok. I think engineers are well capable of evaluating what systems they need to support and if zstd is a usable option for them. In many situations, the answer will be "yes."

Re: Bzip3: A spiritual successor to BZip2

#103
post #22

Earlier quoted context omitted.

zstd is faster and provides better compression than gzip at every point on the curve. There is no reason to use gzip these days other than backwards compatibility.

zstd is a great setup, for sure, but the build system they use is patently awful. Can someone make an autoconf or hell, even CMake build system for them pleasee???

Quick glance of zstd github repo shows they do provide CMake build scripts?

Re: Bzip3: A spiritual successor to BZip2

#104
post #70
post #4

I've studied the Burrows-Wheeler Transform, I understand the transformation, I've re-implemented it countless times for kicks, I see how it improves compressability, but for the life of me the intuition of _why_ it works has never really clicked. It's a fantastic bit of algorithmic magic that will always impress me to see it.

Yeah. BWT and zero knowledge proofs are my goto examples of CS things that seem like pure magic.

Public-key cryptography is magic. Zero-knowledge proofs are a consequence that's difficult to find on your own but easy to understand once you've seen it.

I remember seeing someone (probably Avi Wigderson) demonstrating a zero-knowledge proof for graph coloring on an overhead projector when I was starting my second year studying CS. He had a slide with a graph, multiple slides with different permutations of the same valid coloring of the vertices, and a piece of paper with "doors" over the vertices to cover everything. The audience could ask him to open the doors over the vertices connected by any edge, and he would show that the coloring is valid, as far as those two vertices are concerned. And then he would replace the coloring with another permutation for the next iteration. The idea felt clever but kind of obvious in retrospect.

Re: Bzip3: A spiritual successor to BZip2

#105
post #62

I poke around in this space periodically, but I've never found a compelling reason to move away from gzip.

I am a huge proponent of zstd after I learned about it on HN. I've recently had to compress a 12 Gb csv file. zstd took ~3 sec for compression and ~11 sec for decompression and got the file to ~1.1 Gb. Xz took ~3.5 min for compression(!) and the resulting file was ~740 Mb(I didn't measure the decompression time). I just realized that in most cases it's more efficient to use zstd, especially for file transfer. The maj…

Did you confuse gzip and xz? You mention numbers from xz and then suddenly talk about gzip? These two are not related…

Re: Bzip3: A spiritual successor to BZip2

#106
Small request: write a header or tail block which records the compression efficiency. Bzip2 doesn't. Gzip does. Knowing the uncompressed size can be vital. Yes, there is a risk of lying and making zip bombs.

Re: Bzip3: A spiritual successor to BZip2

#107
post #68

Earlier quoted context omitted.

I always understood it as working because of the predictability of a symbol/letter/token given the previous one. Sorting all the shifts of a string puts all the characters in order, then looking at the last column shows you all the _preceding_ characters. If there's any predictability there (which there often is), it's now easier to compress. It's sorta like an entropy coder in that way. I've never thought of it as b…

Understanding why increasing predictability helps with compression is not the hard part though. What's hard to grasp is why the transform is reversible.

a word can be factored into the set and frequency of letters + the specific permutation. compressable patterns in either channel seem likely when the underlying words are language like.

Re: Bzip3: A spiritual successor to BZip2

#108
post #4

I've studied the Burrows-Wheeler Transform, I understand the transformation, I've re-implemented it countless times for kicks, I see how it improves compressability, but for the life of me the intuition of _why_ it works has never really clicked. It's a fantastic bit of algorithmic magic that will always impress me to see it.

> the intuition of _why_ it works has never really clicked.

In terms of why it aids compression, or why it's reversible?

As far as the first goes: it transforms n-grams into repeated characters.

Re: Bzip3: A spiritual successor to BZip2

#109
post #107

Earlier quoted context omitted.

Understanding why increasing predictability helps with compression is not the hard part though. What's hard to grasp is why the transform is reversible.

a word can be factored into the set and frequency of letters + the specific permutation. compressable patterns in either channel seem likely when the underlying words are language like.

And in general that set of descriptors provides no compressibility. BWT is much richer that that set in that the way it works performs well for data we care about.

Describing a multiset takes as much information as the multiset contained to begin with, on average. BWT somehow works better on things of use.

Re: Bzip3: A spiritual successor to BZip2

#110
post #62

Earlier quoted context omitted.

I am a huge proponent of zstd after I learned about it on HN. I've recently had to compress a 12 Gb csv file. zstd took ~3 sec for compression and ~11 sec for decompression and got the file to ~1.1 Gb. Xz took ~3.5 min for compression(!) and the resulting file was ~740 Mb(I didn't measure the decompression time). I just realized that in most cases it's more efficient to use zstd, especially for file transfer. The maj…

Did you confuse gzip and xz? You mention numbers from xz and then suddenly talk about gzip? These two are not related…

Hey, I didn't confuse them but I guess I should have been more specific. I've addressed 2 main points in my text. 1) In my opinion, for the vast majority of cases you don't need to be worried about comparability, as you can easily install better alternatives to gzip for platforms a lot of people use. 2) I think zstd can become a primary replacement for gzip due to its high speed of compression and good compression ratio, even when compared to such great algorithms like xz/lzma. Sacrificing some compression ratio for (de)compression speed is worth it, for me at least
Post reply on HN