Ad-filter loading and QRegExp performance

Robert Knight robertknight at gmail.com
Thu Feb 1 16:05:28 CET 2007


> Also note that QList does not have this problem. For a complex type like
> QRegExp, QList does not store the elements themselves in the vector. It
> stores a pointer to them. That means one extra malloc(), but no object is
> copied during resizing.

Presumably assignment still takes place when I append an object to the
end of the list though?
The problem here is not to minimize the number of copies but to
prevent them entirely.

I will file a bug report with the Trolls because I think would be very
easy for someone to write code which unintentionally triggered a copy
- and there is no static code checking which can pick up performance
issues like this.  In that case, the expensive parsing process should
be avoided.

Regards,
Robert.

On 01/02/07, Friedrich W. H. Kossebau <kossebau at kde.org> wrote:
> Am Donnerstag, 1. Februar 2007 14:46, schrieb Thiago Macieira:
> > Note that QVector stores the elements themselves in the vector. Every time
> > it grows, it must copy the elements to the new array.
>
> Why doesn't it do just a simple memcpy? Because some elements may have
> subelements which store the address of the mainelement? And offering an
> option for this would have been too complex, I guess?
>
> Friedrich
> _______________________________________________
> Kde-optimize mailing list
> Kde-optimize at kde.org
> https://mail.kde.org/mailman/listinfo/kde-optimize
>


More information about the Kde-optimize mailing list