17 Nov
2016
17 Nov
'16
9:52 a.m.
* Tomas Rokicki <rokicki@gmail.com> [Nov 17. 2016 16:47]:
Representing each result by a row of the form
7 4 3 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 0 1
(for instance) meaning 2^3 3^4 5^3 7^2 11^2 ...
and squeezing out duplicate rows yields something which gzip eats for lunch.
The entire result set through 1M compresses down to 3.0MB.
Bzip2 takes that down to 1.89MB.
[...]
My approach (back-ref and multiplier) gives, for 1M entries, a compressed file of size 142 KiB. I used xz for compression, which seems to be the best amongst gzip, bzip2, and xz. I suspect this method will have the file grow only very slightly worse than linear with the number of entries. Best regards, jj