[Interest] Size of libQt5Core in 5.3

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Sun May 11 13:25:36 CEST 2014


Il 11/05/2014 09:20, Daniel Bowen ha scritto:
> So I started putting in -skip, -no-feature, etc.having features wewould
> still use, but other things stripped out.I also had a mkspec use -Os to
> optimize for size.Usingsomething likethis:

[snip]

Please note that several of those features don't even belong to QtCore, 
but to other libraries.

For instance: image formats, fonts, etc. belong to QtGui; other 
widget-related stuff belong to QtWidgets. You chose to skip those 
modules altogether (-no-widgets) so I don't see why also putting the 
feature switches there. (And, as a side note, I'm not sure that passing 
-no-feature-UPPERCASE would work...)

Apart from this: builds with feature switches are not really tested, so 
I'm not surprised that you have found a combination that doesn't even 
build. But we totally welcome patches that would fix such builds.

In particular, being able to skip building QRegularExpression should be 
able to save a lot -- especially if you not compile PCRE inside of 
QtCore (which brings in some huge Unicode tables). PCRE should add 
around 0,5MB between code and data. Note that this requires some extra 
changes (to configure and tools.pri) to support a non-PCRE build.

Other big players:
* mimetypes support -- bringing in another ~250K of data (i.e. roughly 
the gzipped size of the freedesktop's MIME database), plus its code;
* cryptographic hashes support.

In general you should take an analytic approach: pass

> -Wl,-Map,qtcoremapfile

to QtCore's linker command line, and examine the map file using a 
script. Then proceed to trim.

Hope this helped,
-- 
Join us Oct 6-8 at BCC Berlin for Qt Developer Days 2014!
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4048 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140511/296f2a29/attachment.bin>


More information about the Interest mailing list