Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Increasing dynamic object creation speed
Forum Updated to NodeBB v4.3 + New Features

Increasing dynamic object creation speed

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 2.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.
  • K Offline
    K Offline
    kbcool
    wrote on last edited by
    #1

    Hi,

    I've run into a bottleneck with my application I just can't find a solution for.

    I'm dynamically creating views for a game consisting of usually less than 100 dynamically created objects. The problem is, is that it takes about 8ms on a decent computer to generate each object and on a mobile device (N8) it's taking closer to 14 ms.

    The component has about 12 properties but apart from that is fairly simple - consisting of text, image and rectangle components with some javascript attached to a mousearea.

    I've used Analyzer to determine this is the bottleneck but I can't see a way of drilling further into the call to createComponent to see what's taking so long. I know bindings can take some time but I can't imagine there's more than 40 or so being created.

    Is there any best practise or things to look out for or even a faster way of doing it? If I could create them in bulk even then change the x and y and one property that would work for me.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kbcool
      wrote on last edited by
      #2

      I should mention I'm using Qt Quick 1.0 as I'm supporting S60v5 devices. Which are particularly affected by this slowness.

      Qt 4.7.4 or 4.7.3

      1 Reply Last reply
      0
      • C Offline
        C Offline
        chriadam
        wrote on last edited by
        #3

        Some of the advice at http://qt.gitorious.org/qt/qtdeclarative/blobs/master/doc/src/qml/performance.qdoc is probably still applicable to QtQuick 1.0, although some (eg, scene-graph related) will not be.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kbcool
          wrote on last edited by
          #4

          That is a very useful resource and I made a few changes based on the recommendations but for the most part I was doing it right already.

          Is there a way of seeing inside component creation using Analyzer? The docs don't mention a way.

          All I see at the moment is "Creating component.qml" and the time it's taking. Which is far too long for what it's doing. Analyzer does show about 3 bindings which are taking a few microseconds each (once again times that by 40 and you still only have 120 microseconds). Way short of 8 - 12 ms it's taking all up.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            chriadam
            wrote on last edited by
            #5

            Out of interest, if you remove the image from your component, do the speed problems go away?
            Loading a file on Symbian can sometimes be an issue due to the microkernel architecture (FS access via a server process, etc).

            If removing the Image {} element doesn't make a difference... well, I don't know what the problem could be, to be honest. Generating the text layouts, maybe? If there are any "strange" characters in the text which aren't available in the current font, a deep lookup of an available glyph from any font could cause different font plugins to be loaded by the font engine, perhaps... I'm really not sure.

            The actual painting shouldn't take anywhere near that long, and as you say a few bindings shouldn't be a meaningful contribution to the total. :shrug:

            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