4

When I run Inno Setup on a large set of files (>2GB), it takes a long time to run. I believe it is spending its time in the compression, which should be CPU bound, but it is only using a couple of CPUs. Is there a way to spread this across (many) more cores?

Specifically, I'm working with this boost-release repository, which has an Inno Setup script that includes:

[Setup]
....
Compression=lzma2/ultra64
....

[Files]
Source: "boost_1.69.0/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs ignoreversion
....

Calling Compil32.exe boost_installer.iss takes approximately 25 minutes on a machine with 16 cores and 32GB of RAM (Azure F16s v2).

The set of files is approximately 2.5GB with 2 GB of that being a set of about 300 compiled libraries. The remaining 500MB is 60,000 source files.

teeks99
  • 3,585
  • 2
  • 30
  • 38

3 Answers3

9

So to get to the bottom of this, I created a test project that went through all sorts of permutations of various Inno Setup configuration options.

The ones I found useful (and gave me a 40% improvement in speed!) are:

SolidCompression=yes
LZMAUseSeparateProcess=yes
LZMANumBlockThreads=6

Without SolidCompression, the LZMANumBlockThreads doesn't have much impact. But together, I saw a more typically parallelize-able problem, where more threads gave faster results (to a point).

If you find this interesting, I'd recommend the writeup I did on it, it has a lot of data to back it up.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
teeks99
  • 3,585
  • 2
  • 30
  • 38
2

Try setting LZMANumBlockThreads directive (the default value is 1):

When compressing a large amount of data, the LZMA2 compressor has the ability to divide the data into "blocks" and compress two or more of these blocks in parallel through the use of additional threads (provided sufficient processor power is available). This directive specifies the number of threads to use -- that is, the maximum number of blocks that the LZMA2 compressor may compress in parallel.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
1
Compression=zip

SolidCompression=yes
LZMAUseSeparateProcess=yes
LZMANumBlockThreads=6

use zip compression for 2x faster installations. speed tested. approved. use zip.

Zen Of Kursat
  • 2,672
  • 1
  • 31
  • 47