How do I enable multi-threaded LZMA2 using 7-zip 9.20 on the command line?

Solution 1:

Try -m0=lzma2

"C:\Program Files\7-Zip\7z.exe" a -m0=lzma2 -r -y XMLBackup.zip *.xml

more info

Solution 2:

The help file says it's mt=number_of_threads

I know this is specifically about the command line, but one thing I can say about when using the GUI, as soon as you switch to LMZA2 you got all the options. And it DOES speed up compression a great deal, utilizing the full 100% of your CPU's power rather than the usual 25%.

Solution 3:

7z a -txz -mx=9 -mmt=on out.tar.xz in.tar

-txz uses XZ (LZMA2)

-mx=9 sets the compression level (1 fastest / 9 best compression)

-mmt=on LZMA2 only supports up to 2 threads (either -mmt=on or -mmt=off) but multithreading is on by default

https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm#XZ

Solution 4:

The multithreading mode is given in a -m flag, and it's apparently only implemented for zip, 7z, bzip2 and xz. More specifically, -mmt=<<# of threads>>. However, according to the documentation, it is enabled by default. See the CHM manual included with 7-zip for more information.