2

There are many general purpose compression programs. 7z, zip, tar and etc (https://en.wikipedia.org/wiki/Comparison_of_file_archivers)

Depending on the type of data one may perform better (i.e. speed / size ratio)

I want to know is there a quick way( possibly a heuristic approach) to say that for the given data/file one perform better than another?

  • 1
    tar itself is not a compressor; it can be combined with any lossless compressor, and nowadays commonly is combined with gzip bzip2 xz/lzma although years ago less-effective compressors were used. – dave_thompson_085 Feb 21 '17 at 12:36
  • cool, I didn't know about it. – nafas Feb 21 '17 at 13:00
1

Many different programs use the same algorithms, so compression levels will be similar for different programs for the same formats, though performance will depend to some extent on how they are coded.

ZIP format uses the Lempel-Ziv algorithm, which works well for general text data, but not necessarily for other formats, so specialist algorithms have been developed for other formats.

The other algorithms for different data types use the known characteristics of the data to assist with finding compressible elements, though these are commonly built into the stored files themselves: PNG and FLAC are well-known lossless multimedia formats. Such files can rarely be further compressed, and attempts to do so usually increase the file size.

As for speed, most users prefer the fastest decompression speeds at the cost of slower compression, but there are algorithms which give a different balance, though with generally poorer compression levels.

Without doing tests, you will have to consult the literature: here is a good place to start, though a lot of the article deals with lossy formats.

The only heuristic approach is to examine the algorithms themselves and make up your own mind about how they perform.

As a postscript, note that TAR is an archive format, not a compression format, though the management program will handle TGZ, the compressed TAR format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.