Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Big performance issue with TreeView
Forum Updated to NodeBB v4.3 + New Features

[Solved] Big performance issue with TreeView

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 7.2k 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.
  • K Offline
    K Offline
    Knacktus
    wrote on 10 Oct 2010, 12:13 last edited by
    #1

    Hi everyone,

    I'm having big performance issues with a QTreeView and a custom model. I'm using PyQt 4.7.4 which is based on Qt 4.6.

    To demonstrate the issue, I've created a 'one-child-per-parent' model, which is naturally as deep as it can get. Now, the issue becomes apparent when expanding the whole tree. It takes about 1.5 minutes to expand a tree of 5000 items on a Intel Core7 860. If I can't optimize performance, that would be a showstopper for my project, as I need to handle around 100000 items, however not as deeply nested. Profiling shows, that some methods like parent() of the QAbstractItemModel are called 12'503'272 times for a model with 5000 items!! This can't be the proper behaviour, can it?

    What's going on there? I would have thought it's Python related, but after having seen the profiling I'm puzzled.

    Does anyone have similiar issues? Are there performance tipps besides the setting of the uniformRowHeights property? Or do I have to face the fact that Qt is not the right Gui toolkit for handling large data trees? (Which would be a shame, now that I've started to understand and to like it quite a lot.)

    Any thoughts and recommendations are highly appreciated.

    Cheers,

    Jan

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on 10 Oct 2010, 12:27 last edited by
      #2

      Are you sure that you need all 100000 items at one time? Maybe you can make lazy-loading with fetchMore() method?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alexander
        wrote on 10 Oct 2010, 20:41 last edited by
        #3

        Knacktus, yes, I had same problems with QListView and 100000 elements so I had written my own view and model :(

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on 11 Oct 2010, 07:24 last edited by
          #4

          This issue is something that "itemviews-ng":http://qt.gitorious.org/qt-labs/itemviews-ng is trying to tackle. There hasn't been an update to it since April this year, but hey, that might mean it's scheduled for Qt 5

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Knacktus
            wrote on 13 Oct 2010, 20:20 last edited by
            #5

            Hey everyone,

            first, thanks for your replies.

            I have good news: Following a hint from the PyQt Forum I installed a Python wrapper using Qt 4.7. Now I can confirm what some guy has observed: There's a massive improvement in Qt 4.7.

            My example now takes 0.266 seconds to expand compared to 90 seconds with Qt 4.6!!!! The numbers of method calls also look much more reasonable.

            Rock'n'Roll

            Cheers,

            Jan

            1 Reply Last reply
            0
            • F Offline
              F Offline
              Franzk
              wrote on 14 Oct 2010, 19:57 last edited by
              #6

              Good to know :)

              "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0

              1/6

              10 Oct 2010, 12:13

              • Login

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