[Development] QtCore is 2 MB larger in Qt 5
Thiago Macieira
thiago.macieira at intel.com
Fri Jul 13 15:09:02 CEST 2012
On sexta-feira, 13 de julho de 2012 14.38.09, Olivier Goffart wrote:
> On Friday 13 July 2012 13:11:15 Giuseppe D'Angelo wrote:
> > Random thoughts:
> >
> > On 11 July 2012 20:22, Thiago Macieira <thiago.macieira at intel.com> wrote:
> > > That's 63% bigger.
> > >
> > > Top 20 culprits:
> > >
> > > 251684 .obj/release-shared/qrc_mimetypes.o:.rodata 0x3d724 0x0
> >
> > Are the mimetypes alwasy included, even on GNU/Linux systems that are
> > supposed to have them around (in a "standard location")? That is: is
> > there a way to build QtCore w/o the mimetype data?
>
> It is a huge xml file that is embedded on that resource.
> Maybe we could just store it compressed. (and uncompresed with
> QByteArray::uncompress).
rcc already compresses and QResource uncompresses. The original file is 1.7 MB.
It's a trade-off: we save 1.4 MB in the size of the library (and the size of
flash or installed size), but we increase the heap memory usage by 1.7 MB if we
do need this file. That's unsharable, swap-backed RAM.
If the file were not compressed, it would be sharable, clean and discardable
RAM.
> We could also store a pre-parsed version.
David can comment, but this looks like a good idea.
> Another option would be to ship it with Qt, but as a separate file, not in
> the resource.
That's also an idea.
> Distributions will upgrade their PCRE version as they upgrade Qt.
That means the QtCore size decreases again, but the total VSZ required to run
Qt is still the same. Then again, VSZ doesn't matter.
> > > 57900 .obj/release-shared/qeuckrcodec.o:.rodata 0xe22c 0x0
> > > 134944 .obj/release-shared/qbig5codec.o:.rodata 0x20f20 0x0
> > > 133792 .obj/release-shared/qjpunicode.o:.rodata 0x20aa0 0x0
> > > 117842 .obj/release-shared/qgb18030codec.o:.rodata 0x1cc52 0x0
> >
> > Codecs linked in instead of in plugins or what?
>
> Yes.
> https://codereview.qt-project.org/#change,12955
> The problem is that codecs in plugin do not really work as we need codecs to
> load plugin (in order to convert the paths, and so on)
> What Qt did is to consider everything as latin1 before they were loaded. But
> this was not working well.
>
> In the long term, Qt should not have its own code for all those codecs, but
> rely on the platform libraries.
That's the plan for Qt 5.1.
We need to replace those codecs with ICU.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120713/b98adb8e/attachment.sig>
More information about the Development
mailing list