7-Zip compression on multi-core computers
Does 7-Zip take advantage of multiprocessor or multi-core systems when compressing?
For example, would there be a close to 16 times speed-up on a 16 core system assuming no disk or memory bottlenecks?
Or is it is limited to 2 threads (2 times speed-up on systems with more than one CPU or core)?
Edit: To summarise: the current stable version of 7-Zip (and older) does not take full advantage of more than 2 CPU/cores when compressing as 7z (only for Zip and BZip2), but version 9 (currently in beta) does. The command-line option for using 16 cores with version 9 is (this is in the installation folder for the Windows version, in the help file, 7-zip.chm
, Command Line Version/Switches/-m (Set compression Method)/<near> "Sets multithread mode"):
-mt16
You have to use the beta version to get access for more cores. Beta is like stable at other softwares, don't worry about it. There was an explanation in a forum post on the official site. I'm using it for a while already, and there is no problem with it.
By the way I'm using 7z 9.13 beta x64 at the minute. Using it on productive environments also, awesomeness. (Thanks Igor for the great software. ;))
While creating a 7-Zip file it can use two threads, while creating a ZIP file it can use eight threads (on my eight-core machine).
You could also use the 7-Zip Zstandard version, which supports threading up to 256 threads for all 5 additional codecs.
The codecs are:
- Brotli
- LZ4
- LZ5
- Lizard
- Zstandard
Run it like:
7z a archiv.7z -m0=brotli -mx1 -mmt=1
...
7z a archiv.7z -m0=brotli -mx1 -mmt=256
According to the Wikipedia article:
Features 7-Zip supports many features, including:
- Support for the 256-bit AES cipher. Encryption can be enabled for both files and the 7z directory structure. When the directory structure is encrypted, users are required to supply a password to see the filenames contained within the archive, unless only the data was encrypted but not the filenames. WinZip-developed AES encryption standard is also available in 7-Zip to encrypt ZIP archives with AES 256-bit, but it doesn't offer filename encryption as in 7z archives.
- Volumes of dynamically variable sizes, allowing use for backups on removable media such as writable CDs and DVDs.
- Usability as a basic orthodox file manager when used in 2-panel mode.
- Multiple CPU / core / threading settings can be configured.
- The ability to attempt to open EXE files as archives, allowing the decompression of data from inside many "SetUp" or "Installer" or "Extract" type programs without having to launch them.
- The ability to unpack archives with corrupted filenames, renaming the files as required. The ability to create self-extracting archives although cannot do so for multi-volume archives.
So open up the application and see what multi-threading is supported.