Better. zip .7z or .rar?
Often we don’t even pay attention to it, but when we click on a ‘zipper’ file, we are using sophisticated compression algorithms that over the years keep getting better and better.
There are many algorithms and therefore compression formats:
Zipper, Rar, GZip, BZip2, 7z, Tar, Tar.gz …
Among the most popular on Windows we have: 7z, Zip and Rar.
The first and the second one are free, the latter is not and its developer is the owner (the program that manages this format is WinRar).
To create a zipper file you need to choose an algorithm. The default one used by Windows (for example) is the classic DEFLATE, not very performing. While the program 7z (always for zip creation purposes but with 7z extension) the most efficient LZMA and LZMA2.
Rar has been gradually improved over the years and has recently arrived at version Rar5.
The default compression is Rar4, you can select version 5 of the compression algorithm by opening the rar file management panel (with the right click on the file to compress>Add to archive).
In general, both Winrar and 7z have a of 30-40% higher performance than that of the simple zip.
In addition, Winrar seems to be the only one able to preserve (when unpacking) the original dates of previously compressed folders.
The performance of the compression/extraction varies, however, depending on the file that we are going to use, the dictionary chosen, and the machine on which we are operating. With the same factors (therefore changing only the algorithm) from some tests, 7z seems to have a slight advantage (5%) over Rar.
News of Rar5
For starters, Rar5 increases the size of the compression dictionary up to 1GB (in the 64bit version).
What this means: the larger the dictionary, which is used to store common parts of a file to be compressed, the better the compression will be, i.e. the less space it will take up once compressed; although this only applies to large files (>1GB for backup purposes).
The default size of the Rar compression dictionary is 32MB.
In addition, Rar5 also brings the novelty of the ‘restore registry’: Format 5 is much more resistant to damage and loss bits than 4 and is able to reuse even partially corrupted restore data.
Finally, with Rar5 it is possible to encrypt data with 256bit AES encryption key algorithm (a very robust key, used for example also by the U.S. government).
Note: files compressed in Rar5 can only be read by WinRar5.
Advantages of using Rar4 and Rar5 compared to 7z
In terms of compression speed, Rar5 proved to be superior to 7z.
In a test published on the Hyperspin forum, WinRAR 5 decompressed a 5 Gigabyte image in two minutes compared to almost six minutes of 7Z.
As far as compression is concerned, the speed of the Rar algorithm is impressive in both Rar5 and Rar4.
Note that the normal level of Rar5 uses 32MB dictionaries, which has significantly increased the compression time.
The results of 7zip were not satisfactory in the case of LZMA, which is the default algorithm used by 7z.
Not even using eight multithreading cores can overcome RAR4.
Compatibility and security
As for compatibility, if we want our Rar to be as compatible as possible (if we have to share it with someone) it is advisable to compress it in Rar4.
Otherwise we can always create a self-extracting Rar5, and send that one: we won’t need software to decompress it.
In this case, however, we will always be limited to software that requires a license. 7z on the contrary is open source and also accessible from command line, so for compatibility wins compared to Rar.
As far as encryption security is concerned, Rar5 wins by far, which is on a par with Zip file security (note: zipper not 7z).