Re: Ad-filter loading and QRegExp performance
"Robert Knight" <[email protected]> Thu, 1 Feb 2007 15:05:28 +0000
| Newsgroups | gmane.comp.kde.devel.optimize |
|---|---|
| Message-ID | <[email protected]> |
> 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 <[email protected]> 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 > [email protected] > https://mail.kde.org/mailman/listinfo/kde-optimize >