[Qt-interest] QList vs QVector
Tom Panning
lurchvt at gmail.com
Wed Aug 5 14:17:49 CEST 2009
On Wed, Aug 5, 2009 at 2:27 AM, Ankit Agarwal<ankit17.ag at gmail.com> 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 ?
It's hard to say without seeing the code that you're using to
benchmark. If you can post a small, compilable test program that shows
the difference we may be able to answer your question.
Tom
More information about the Qt-interest-old
mailing list