[Interest] Installation Sizes for Applications using Qt

Henry Skoglund henry at tungware.se
Mon Aug 30 21:23:54 CEST 2021


On 2021-08-30 20:48, Thiago Macieira wrote:
> On Monday, 30 August 2021 10:32:03 PDT Henry Skoglund wrote:
>> configure that has a "-skip xxxx" for all
>> modules expect qtbase.
> That makes zero difference in your final binary.
>
> If you need a library that wasn't compiled, your application will fail to
> link. If you have a library that your application doesn't link to, it won't be
> linked to.
>
> The convenience "-skip" option to the top-level configure is not at all the
> same as the feature system that we're discussing.
>
>> When using MinGW 8.1.0 the .exe size is 19151 kB and when using MSVC2019
>> it becomes 11616 kB, i.e. 40% smaller.
> Do note that both QtCore and QtGui are compiled with -O3, which expands code
> size, when using GCC or Clang. There's no equivalent option to MSVC. You may
> want to disable this feature too and stick to -O2.
>
> You may also want to optimise for size, at the expense of runtime performance.
> That's usually not worth it.
>
Thanks Thiago for the clarification re. those "-skip xxx" options. I 
guess I can skip them :-)
Ok, one benefit remains: saving some time when compiling/building the 
static Qt version.

Re. compiler options, I'm too lazy and just go with the default settings 
that Qt gives me, and since they provided a 40% decrease of the final 
.exe size when switching to MSVC I'm happy.

Riddle me this though:
for 5.15.2 I built 2 MSVC versions: one with built-in SSL 1.1.1K support 
and one without.
When I build a hello world widget app, the .exe file without SSL lands 
at 10541 kB but the one *with* SSL 1.1.1K support is 10531 kB. Why is 
the .exe file with more functionality smaller??



More information about the Interest mailing list