7-Zip. How many CPU cores are used?

Hi there,

As you probably know, when using 7-Zip with LZMA2 and more than 2 CPU cores, the result file will be a little bigger than when using only 2 cores, because of the way LZMA2 works and distributes the blocks to compress among them.

So, my question is, compressing in DO to .7z with the "Use multiple threads" option checked, how many threads does it use? All available? (i.e. 4 in a quad core CPU). If so, is there a way to limit it to use only 2? I've looked at the plugin configuration but saw no mention to that.

I'm currently on a dual core CPU, hence why I can't check this myself, but I'm planning to upgrade soon and I'd still like to be compressing at the best possible ration, even if it's a quad core CPU.

Thanks

LZMA2 isn't using all the cores, at least at the moment (see here), although that may change once I look into it. (Maybe it's like that for the reason you give.)

We probably won't add anything more granular than the "use multiple threads" option. If you want to specify exactly how many threads should be used, you can use 7-Zip itself for that. (But our thinking on that might change once I look into the LZMA2 threading stuff, if there are compelling reasons for wanting more than just on/off for multithreading.)

Didn't know that.

Quick test on my system (packing my firefox profile):

Firefox-LZMA2-Multithreaded.7z    =    34.624.319 Bytes
Firefox-LZMA2-Singlethreaded.7z   =    34.641.521 Bytes

Firefox-LZMA-Multithreaded.7z     =    34.685.585 Bytes
Firefox-LZMA-Singlethreaded.7z    =    34.673.528 Bytes

Firefox-Multithreaded.rar         =    36.672.841 Bytes
Firefox-Singlethreaded.rar        =    36.669.931 Bytes

PS: However the multithreaded feature for 7zip/LZMA2 in DOpus currently doesn't use all available cores (as Leo said).

This test (packed a 31 GB virtual machine) shows how much more efficient 7zip is than WinRAR in certain cases:

VM-Win7-64.7z   =  4.296.600.250 Bytes
VM-Win7-64.rar  =  5.038.297.237 Bytes

I just saw your thread, in my case it uses both cores on the computer. OK then, I'll wait to see how this turns out, I'm glad at least we posted leo our concerns.

Thanks both.