How To Think About Compression
changelog.complete.org
changelog.complete.org
Life is strange sometimes...
What I started wondering about is if there's a chance of achieving better compression results if the compressor and decompressor could communicate about the compression before it happened. For example, (ignoring CPU constraints) what if when I was downloading a large file over the web, the web server and the browser conspired together to achieve a higher rate of compression customized just for me by using some kind of shared knowledge (like a history of what was recently downloaded or whatever) to achieve a transfer of less data? (Like, if I had a bunch of files on my client that the server also has, could it use small chunks of those known files and index their location in the new file to be transfered - thus saving me download time?)
Obviously this is not a fully formed thought... but I think it might be worth considering that compression need not always be bound by the type of data, but also by the receiver of that data and the intention and method of that data's transmission.
That example is silly and extreme to illustrate the point. In your parenthetical example, the costs to be accounted for include not only the index information but also the catalog of shared files.
The idea is that if you copy two similar files from the server, it can check the hashes and tell your client to use parts of a file it already has instead of transferring them (or only copy changed parts of a big file).
I have no source handy to find more details about exactly what scenarios it will be used at the moment though.
but I think it might be worth considering that compression need not always be bound by the type of data, but also by the receiver of that data and the intention and method of that data's transmission.
It is. This is why we have various entropy-coding schemes for important data (arthmetic, golomb, huffman, lzw, burrows-wheeler/bzip2, rle), and lossy compression for data that doesn't need to be perfect, such as audio, video, and imagery (mp3, h.264, jpg) which use irreversible transforms to pack a lot more information in each bit.
Your other idea has been done, too, with "WAN optimization", but it generally isn't helpful for one person, because you already have good caching and proxying going on, even if you don't realize it. That works when multiple people are pulling down the same contents.
Basically, already done.
At this point, if you start going "But what if we also did this...!", you are about 95% likely to start getting into the compression crackpot zone. Information can only be squeezed so hard and once you start proposing other exotic solutions the only explanation that works in response is usually "No, that won't work, but you won't believe me, so, prove it. Implement it and sell it for millions of dollars. Be sure to count all the bytes, not just the ones you like." And generally, that's the end of that.
I am far more likely to believe that you have built a working anti-gravity device, which is at least at the very edge of plausibility under certain not-yet-disproven physical theories, than that you have actually made a huge compression advance, which is effectively mathematically impossible. (Not because compression can't be advanced, but because it's only going to advance incrementally from now on. There's no room left for a breakthrough in the general case.)
http://research.microsoft.com/apps/pubs/default.aspx?id=6469...
An interesting point about their approach is that it is independent of file size: they just need to keep 96 bits of metadata per file.
Something similar to the way CDs are written to be able to handle scratches should work well in this case.