What is the best format for compressing files? We analyze the most popular compression methods - NewCydiaTweaks

Breaking

Post Top Ad

Post Top Ad

Saturday, February 25, 2017

What is the best format for compressing files? We analyze the most popular compression methods


Today we bring you a slightly different article. We will analyze the most popular compression formats that allow us to compress any type of files without losing information. What is  fast ? The most powerful ? And the most used ?

What is File Compression? What does it mean to compress?

Have you ever encountered a file that was too busy and did not know how to make it take up less, for example, to send it to a friend by mail? That's what compression is for.
Compressing a file allows us to reduce the file size . This will take up less space on the hard drive, and will be easier to send. Depending on the type of file and type of compression used, its size will be reduced more or less.
As we have just said there are several types of compression methods :
  • With losses . This is the compression method used to compress video, audio or image files , for example. The main feature of this method is that compression performed by compressing approximations , so the media file size reduces. The problem is that the approach is something irreversible, and therefore quality will be lost when viewing / playing the multimedia file.
  • No loss . Unlike in the previous case, this information is not lost . This method looks for patterns that repeat, in addition to other more advanced methods. This is achieved by reducing the size of a file without losing information or quality, although obviouslythe size of the file is not reduced as much .

What compression formats are there and which ones are most popular

In terms of formats and compression methods we have a wide range:
  • With losses. In the case of loss, we have a multitude of formats depending on what they are intended for. This is because compression algorithms are only valid for one type of files , ie if you try to compress an audio file with an image compression algorithm, it will not work. And what do we have in this area? For example, in the case of images we have JPEG, which is the most popular. In video we have formats like MPEG (all its variants), MP4 and OGG. In the case of audio we have AAC, OGG and WMA. Surely some of these already sounded, right?
  • No loss. But all those lossy compression formats do not interest us for this article. We are interested in lossless formats, among which are generic algorithms (which compress any type of file), such as ZIP or RAR. These are the most popular, especially the ZIP, as it is the default on most operating systems.

Comparison of generic lossless compression formats

Now we will proceed to analyze the most famous compression formats. In particular we will analyze the ZIP, GZIP, BZIP2, TAR and 7z . And what about the RAR ? Although this is the second most popular, it is not free, and therefore we will not analyze it in this article. In addition, being a proprietary format compression in this format is complicated without the official application (although there are no problems when decompressing).
The first parameter to analyze will be the compression speed . What is the fastest compressing? For these tests we have compressed a virtual machine , and we have done it on a MacBook Pro with a second generation Intel i5 and 8GB of RAM (compression was done on a 5200rpm HDD disk connected internally by SATA). Also mention that we use the Keka tool , which is compatible with macOS and is free.
For our second test we will see just the opposite. How long does it take to decompress ?
And finally, what parameter remains to be checked? Well, the degree of compression , no doubt. If we do not analyze how much space we save this article would lose its meaning. Well, this is the result:
As we can see, the most compressed turned out to be 7z .
And the least TAR ... actually did not compress anything ... why? For a simple reason: I have deceived you. Tar is not a compression format, it is a container file . That is, it does not reduce the size, but only encompasses several files in one, is like converting a folder into a file directly (what is technically known as packaging). This format is used together with others like BZIP2 or GZIP , as these only compress, do not package.

Compression mode

Finally, to conclude this article mention that the vast majority of formats allow to select the amount of compression. The "normal" mode is the one we used for the previous tests and the most recommended, because it compresses enough but it does not take long. The difference in compression between "normal" and the one of greater compression is little, but the time that takes is much greater. On the other hand, if we use the fastest mode it will only compress. Therefore, a balance is necessary.
To do the test we compress the same file as before in ZIP with the maximum and minimum compression . Although, this test could also be performed with the other formats (less Tar, as it does not compress). This is the result:

Conclusion

Those are the results we have obtained from our tests. We hope you serve as a reference , although not as something accurate. Above all, the result of time trials must be taken with care, because many things can influence that. But it serves to give us an idea.
As you can see, there are multitude of formats and multitude of options. Which one will you keep? Which do you usually use? I usually use * .zip, although sometimes I also use * .tar.gz, for its enormous versatility.
Do not forget to tell us if you want more articles of these, or if you would like us to explain how they work internally.

No comments:

Post a Comment

Post Top Ad