On Fri, Oct 31, 2014 at 4:25 PM, Grant Edwards <grant.b.edwa...@gmail.com> wrote: > > You're cheating. The algorithm you tested will compress strings of > arbitrary 8-bit values. The algorithm you proposed will only compress > strings of bytes where each byte can have only one of 10 values. >
Of course. I wasn't expecting the general-purpose algorithm to do as well. In some sense, part of the information that is being encoded is actually in the compression algorithm itself (the mapping), while in a general-purpose compression algorithm that information has to be part of the compressed data stream. I was just expecting gzip/etc to get much closer to the theoretical limit. I figured that it might be a few percent higher, but I wasn't expecting a 10+% difference. -- Rich