50

I normally use WinRAR over 7-Zip simply because it's faster and only a little less efficient with compression. I did a few tests on different file types and sizes comparing the 7-Zip and WinRAR default settings on their normal compression and their best compression, and in a lot of cases WinRAR was 50% faster and in some it was actually 100% faster. But, I do like FOSS more. So here are my questions:

  1. Is there a way to make 7-Zip speed-up? I'd like it to at least be on par with WinRAR's speed
  2. Is there a way to make recovery segments in 7-Zip like you can in WinRAR? I didn't see any, but I guess it could be a command line thing.
  3. I tested WinRAR and 7-Zip using the latest stable version of each (4-dot-something with 7-Zip). Is the 9.x beta release noticeably faster at compression?

I'm talking about faster at a comparable setting in WinRAR, not just lowering to bare minimum compression.

If it matters, I use a quad core Intel i7 720 (1.6 GHz)/(2.8 GHz) with 4 GB DDR3 RAM, and the 64-bit version of 7-Zip, and dual-boot Debian x64 5.0.4 and Windows 7 Home.

Run5k
  • 16,463
  • 24
  • 53
  • 67
Kefka
  • 1,536
  • 2
  • 17
  • 32

7 Answers7

39

If you get the 7-Zip 9.13 beta you can change the archive type to LZMA2 and thus be able to use as many threads as you like, though the memory usage goes up phenomenally.

Install the beta, right click the stuff you want to archive then under the 7-Zip contect menu click "Add to archive..." and you will get something similar to the window below. On the left hand side under Compression Method you should find "LZMA2" which will allow you to change the number of threads which will be an option a bit further down.

This has the potential of vastly increasing performance on >2 core processors as it can be better tuned to your system, and the normal compression method can only handle 2 threads maximum.

The "/1" you see to the right of the number of threads selection box in the image is the number of processors in your system and thus the recommended number of threads. My i7 is a quad core processor but has hyperthreading (which does actually help here btw) so it shows as "/8"

alt text

Gareth
  • 19,080
Mokubai
  • 95,412
38

As each thread seems to compress multiple files at the same time, the best thing you can do to increase performance of very large zip jobs is to set threads to 1, to be sure that your hard drive will seek one file at a time.

We improve performance on all our daily zip-backup procedures by adding -mmt=off to 7-zip command line. Our backup of the "visual SVN repository", which is made from multiple small files, was taking between 50 and 60 minutes.

With -mmt=off, we now always do in in less than five minutes! And, during these 50 minutes, all our servers were very slow because of the hard drives seeking. Now, everything remains very fast during those five minutes.

For everything you do on a machine, the hard drive activity will always be slower than your CPU capacity. You can increase disk performance by disabling parallel activities and making sure that the hard drive reads (and write) your files one by one serially.

Also it's better to read from disk1 and write your ZIP to disk2, as the physical head does not move from read to write.

Sample line to get maximum ZIP speed while keeping your machine performance:

start "" /wait /belownormal c:\Progra~1\7-Zip\7z.exe a -tzip -mx=1 -mmt=off t:\backup.zip d:\folderToBackup\*

D: and T: are 2 different physical disks

slhck
  • 235,242
0

In my company, we are working with an old version of 7-zip (4.52 beta), and we are running the following command:

"C:\Program Files\7-Zip\7z.exe" a -mx7 -mmt -sfx -xr!*.<exclude_extension> <destination>.exe <source_directory>\* 

This is working fine, but after just having upgraded to the newer version 16.04 (32-bit), the performance has dropped enormously, so I've decided to downgrade back to the old version.

Dominique
  • 2,373
0

Another little trick to improve performance when you use code like this example:

$7zip = "$env:ProgramFiles\7-Zip\7z.exe"
set-alias sz $7zip
$FileZip = "$DiscoZip\temp\$TempFile"
foreach ($DirData in $ListDir) { $out7z = (sz a $FileZip $DirData) }

is, if possible, have in the array $ListDir listed the directories by size, from the smallest to the largest. This happens because at each foreach cycle 7zip creates a temporary file that is as large (or larger) than the original one, then add new file inside them. I have tried with cases in which there are two or more directories large some MB and one large many GB and the saving of time is in the order of several minutes.

user219095
  • 65,551
0

You don't need the beta version anymore. Just make a 7z or bz2 file for multithreading. Bz2 is faster. You can make a zip file with bz2 compression with the -m0 option (not -m like in the docs).

js2010
  • 713
-3

My guess is that speeding up 7-Zip is impossible without re-writing its compression/de-compression algorithms, there may be some kind of tweak that increases speed but it will probably only be like a 10 or 15% increase, not a massive 50-100% increase that you're looking for.

Joshkunz
  • 576
-3

All of the compression algorithms I've used recently (ZIP, RAR, 7z, tar/bzip2) are I/O bound, not CPU bound. Watching MenuMeters on my Mac laptop shows constant disk activity, but only 50% or less CPU activity.

Thus, the way to speed up compression/decompression is to speed up your disk. This isn't always possible.

My "solution" to this is to just do something else while I'm compressing something. :-)

chrish
  • 980
  • 1
  • 6
  • 9