[Qt-interest] QList vs QVector

Andre Somers andre at familiesomers.nl
Wed Aug 5 09:46:27 CEST 2009


Ankit Agarwal wrote:
> Hi Martin,
> Thanks for the detailed information. In my case, I am not editing the 
> list many a times, i.e. insertions and deletion operations are not 
> being done. Thus, I though of using QVector, as the data shall be 
> stored in adj. memory location giving be faster access(QVector of 
> 50000 elements). But, what I observed was that QList is giving be a 
> lower traversal time than QVector. Why am I getting such behavior ?
>
Why don't you run your testcode through callgrind, visualize it using 
e.g. kcachegrind and see for yourself? It's easy to do...

André




More information about the Qt-interest-old mailing list