29

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
1
  • 1
    I don't think the summary is quite accurate, see some of the other answers for more details...
    – rogerdpack
    Dec 10, 2012 at 16:23

4 Answers 4

15

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.

First

Second

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. ;))

7
  • 5
    Since then, a new stable version came out, which supports multi-threaded compression by default, no need for the beta release.
    – Apache
    Jan 8, 2012 at 22:41
  • 1
    That's not correct. It can use 4, 8, and more cores. Just use the latest version. Gosh.
    – Apache
    Jan 10, 2012 at 20:08
  • See:noob.hu/2012/01/10/7z.png
    – Apache
    Jan 10, 2012 at 20:09
  • 5
    Note that this answer uses LZMA2 and not LZMA. LZMA2 can use more than two cores by splitting the file into chunks and independently processing them. This can result in LZMA offering higher compression ratios. Nov 5, 2012 at 8:22
  • Looks like it has to be lzma2 or bzip2.
    – js2010
    Sep 30, 2023 at 16:09
5

You could also use the 7-Zip Zstandard version, which supports threading up to 256 threads for all 5 additional codecs.

The codecs are:

  1. Brotli
  2. LZ4
  3. LZ5
  4. Lizard
  5. Zstandard

Run it like:

7z a archiv.7z -m0=brotli -mx1 -mmt=1

...

7z a archiv.7z -m0=brotli -mx1 -mmt=256

2
  • This is a very good answer. 7-zip ZS seems to have a great deal of choices. It also uses beyond 16 Cores as of today, 7Zip is limited to 16 cores. 32 threads. Which actually is not an issue by itself since 32 threads is good enough and doesnt get us a more performance improvement in either situation. What I like is the array of choices in 7z-ZS. However ZS remains a bit unstable and I had to kill the process several times to get it to cancel an operation. Jun 4, 2021 at 3:36
  • yes, if I select the bzip2 compression method when creating .zip archives in 7zip I definitely see all 16 cores being used of my 16 core CPU! Aug 15, 2021 at 8:30
4

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).

4
  • 1
    You can use 7z with LZMA2 method to use maximum cores
    – Behrouz.M
    Jun 16, 2013 at 13:29
  • 2
    @raypixar Doesn't work for me in a i7 computer. Only BZip2 algorithm allows it runs full 8-threads, other algorithm doesn't run 100%, only ~20% at best. EVen LZMA2 displays 8/8 core in setting panel but when processing, it only ultilize ~20% CPU.
    – Edward
    Nov 11, 2014 at 9:41
  • 1
    @Edward: can't confirm your numbers / experience: on my i5 7z-9.22beta utilizes between 75% and 95% cpu and spawns between 8 and 32 threads to archive a ~240mb folder full of mp3s. .bz2.7z took ages, .lzma2.7z was pretty fast (all ultra-settings) and just a little bit bigger than .bz2.7z.
    – akira
    Nov 11, 2014 at 9:59
  • 1
    @akira Yeah, I know. Anyway the previous comment direct to member "ray pixar" suggestion - use 7z with LZMA2 to use all cores, but in my case it doesn't. About your numbers, I think it's logical. I search in this su site more times after reading this article and found out maybe something wrong with my current 7zip install. But problem only appear in GUI (graphic UI), it doesn't use over 20% CPU when I compress files with LZMA2 method. Only when I use command line with parameter such as -m0=lzma2 -mmt=8 the compression take 100% cpu, otherwise with GUI, I haven't figured out why it doesn't.
    – Edward
    Nov 11, 2014 at 16:02
2

According to the Wikipedia article:

Features 7-Zip supports many features, including:

  1. 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.
  2. Volumes of dynamically variable sizes, allowing use for backups on removable media such as writable CDs and DVDs.
  3. Usability as a basic orthodox file manager when used in 2-panel mode.
  4. Multiple CPU / core / threading settings can be configured.
  5. 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.
  6. 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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .