[Development] HEADS UP: Don't use QList, use Q_DECLARE_TYPEINFO

Milian Wolff milian.wolff at kdab.com
Sun Jul 12 23:53:49 CEST 2015


On Monday, July 13, 2015 12:45:00 AM Marc Mutz wrote:
> On Sunday 12 July 2015 22:55:04 Alejandro Exojo wrote:
> > With respect to "less code in your executable", note that in your blog
> > post
> > 
> > you said:
> > > On the positive side, QList is a real memory saver when we talk about
> > > the
> > > amount of code generated. That is because QList is but a thin wrapper
> > > around an internal class that maintains the memory for void*s. This
> > > leads
> > > to more compact code, because all the memory management code is shared
> > > between QLists of different types.
> > 
> > Does this mean that it changed in Qt5, or am I missing something? Because
> > I  still see QVector being a pure header class, while some part of QList
> > is in the cpp file.
> 
> Since that was written, I have seen QVector create less executable code than
> QList. In theory, QList should expand to less memory, but inefficient
> QLists, what with the heap allocations, probably uses more. Haven't
> investigated much.

From what I've heard from Volker (in CC), he's seen roughly the same code 
bloat from QList and QVector. Volker, could you give us some numbers please?

Bye

-- 
Milian Wolff | milian.wolff at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5903 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150712/d8f1906b/attachment.bin>


More information about the Development mailing list