Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can reading zipped files be faster than uncompressed?

Tags:

compression

Is there any chance that packing a large file with some simple algorithm enables me to read the data faster than from an uncompressed file (due to the hard drive being slower than uncompressing)? What kind of compression rate would I need to have? Can any fast compression algorithm do that?

like image 536
Gerenuk Avatar asked Dec 09 '13 11:12

Gerenuk


2 Answers

Yes. That is often the case with deflate compression, used by zip, gzip, and zlib, when reading from hard drives with a typical compression factor of, say, four.

From SSDs, you may need to go to something with faster decompression. One you could try is lz4.

Your mileage may vary.

like image 72
Mark Adler Avatar answered Nov 19 '22 04:11

Mark Adler


You could also try Density, its command line client "sharc" is benchmarked here.

like image 23
zelix Avatar answered Nov 19 '22 04:11

zelix