本文介绍了使用Inno Setup更快地创建安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在大量文件(> 2GB)上运行Inno Setup时,需要很长时间才能运行.我相信它将时间花在压缩上,这应该是受CPU限制的,但是它只使用了几个CPU.有没有办法将其分布在更多的内核上?

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?

具体来说,我正在使用这个 boost-release存储库,有一个Inno Setup脚本,其中包括:

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

在具有16个内核和32GB RAM(Azure F16s v2)的计算机上,调用Compil32.exe boost_installer.iss大约需要25分钟.

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

文件集约为2.5GB,其中2 GB是一组约300个已编译的库.剩余的500MB是60,000个源文件.

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.

推荐答案

因此,要深入了解这一点,我创建了一个测试项目,它经历了各种Inno Setup配置选项的各种排列.

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.

我发现有用的(并使我的速度提高了40%!)是

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

SolidCompression=yes
LZMASeparateProcess=yes
LZMANumBlockThreads=6

没有SolidCompressionLZMANumBlockThreads影响不大.但是在一起,我看到了一个更典型的可并行化的问题,其中更多的线程给出了更快的结果.

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.

这篇关于使用Inno Setup更快地创建安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-20 19:35