3 ms·
See: http://lemire.me/blog/archives/2012/02/08/effective-compression-using-frame-of-reference-and-delta-coding/ http://lemire.me/blog/archives/2012/02/08/effect
by ars 13y ago
See: http://lemire.me/blog/archives/2012/02/08/effective-compression-using-frame-of-reference-and-delta-coding/ http://lemire.me/blog/archives/2012/02/08/effective-compress...
You can use it for text but it won't work as well. It's designed for numbers that are created by some kind of real process.
It compresses by looking for the largest and smallest number and only storing the difference from the smallest number, and only as many bits as needed for the largest. (Good for situations where most of your data lies inside a range.)
It stores the difference between successive numbers. (Good for measuring a process that varies slowly.)
Also see: http://en.wikipedia.org/wiki/Golomb_coding http://en.wikipedia.org/wiki/Golomb_coding which works on the principle that small numbers show up more than large.
None of that makes sense for text which doesn't have those patterns.
- skyebook 13y agoThanks for the explanation, definitely an interesting routine and the performance numbers he touts in the blog post make it something I'd definitely look to test on my own