Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. The Lounge
  4. Linked list versus Vector
Qt 6.11 is out! See what's new in the release blog

Linked list versus Vector

Scheduled Pinned Locked Moved The Lounge
10 Posts 6 Posters 7.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    john_god
    wrote on last edited by
    #1

    Just found this very nice arcticle "http://www.codeproject.com/Articles/340797/Number-crunching-Why-you-should-never-ever-EVER-us":http://www.codeproject.com/Articles/340797/Number-crunching-Why-you-should-never-ever-EVER-us

    The author compares linked list performace versus vector, leaving other containers out of the discussion.

    I usually use QList for general porpuse, (I think that's the Qt docs recommend way). Any one care to share opinions about Qt/other containers?

    1 Reply Last reply
    0
    • U Offline
      U Offline
      utcenter
      wrote on last edited by
      #2

      There is a fairly comprehensive comparison between different containers in Qt with their strengths and weaknesses:
      http://doc-snapshot.qt-project.org/4.8/containers.html

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        In Qt5, QVector is recommended over QList, AFAIK. There was a long discussion on dev mailing list about it more or less a month ago. IIRC, QVector has benefitted widely from refactoring and C++11 support, making it the preferred choice. I don't remember any details, though :(

        (Z(:^

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          "Understand the Qt containers":http://marcmutz.wordpress.com/effective-qt/containers/
          "Container Refactor Update":http://lists.qt-project.org/pipermail/development/2012-June/004566.html

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            Perfection itself, Lukas, thanks :)

            (Z(:^

            1 Reply Last reply
            0
            • J Offline
              J Offline
              john_god
              wrote on last edited by
              #6

              Nice links, thanks.

              1 Reply Last reply
              0
              • B Offline
                B Offline
                broadpeak
                wrote on last edited by
                #7

                From the legendary "Real Programmers":http://www.pbm.com/~lindahl/real.programmers.html article:

                "As all Real Programmers know, the only useful data structure is the Array. Strings, Lists, Structures, Sets-- these are all special cases of arrays and can be treated that way just as easily without messing up your programming language with all sorts of complications."

                :)

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  Just as any Real Biologist knows, that the only useful life form is a single-celled organism. Mice, humans, dogs - these are all special cases of collection of single-cell organisms, etc. ;)

                  Nice article, BTW, I have not stumbled upon it before.

                  (Z(:^

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    broadpeak
                    wrote on last edited by
                    #9

                    [quote author="sierdzio" date="1345558670"]Just as any Real Biologist knows, that the only useful life form is a single-celled organism. Mice, humans, dogs - these are all special cases of collection of single-cell organisms, etc. ;)[/quote]

                    Absolutely :)

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      kurt.pattyn
                      wrote on last edited by
                      #10

                      At Qt Dev Days 2013, there was a talk called 'Apps on Speed' where Millian Wolff from KDAB, showed some performance numbers of QVector vs QList. The conclusion was: always use a QVector, unless you want to insert something in the beginning or in the middle of a list.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved