On Wednesday, 26 April 2017 02:02:49 -03 Marc Mutz wrote: > FWIW: I'm against adding even more pessimising goodies to QVector. An > area for push_front is such a goodie. The addition this causes is > probably the reason why a QList, even for optimal payloads, is > outperformed by QVector in my well-known benchmark from -Wmarc. Users > that need a queue can use std::deque. If you don't iterate over it, it's > a more than acceptable container.
We don't need to preallocate area in the beginning. But in the case the user is doing prepend() or takeFirst(), the optimisation can kick in. The former can happen entirely behind the scenes by QArrayData; the latter can be as simple as advacing the begin pointer instead of memmove()ing the elements. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
