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. Performace Problem with Text

Performace Problem with Text

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 4 Posters 2.1k Views
  • 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.
  • F Offline
    F Offline
    fyDe
    wrote on last edited by
    #1

    Hello there,

    at the moment i struggle with some Performance Problems of my App I Develop in QML.

    I generated a new example Qt Quick-UI so demonstrate my problem

    @import QtQuick 2.2

    Rectangle {
    width: 360
    height: 360
    Text {
    anchors.centerIn: parent
    text: "Hello World"
    }
    MouseArea {
    anchors.fill: parent
    onClicked: {
    Qt.quit();
    }
    }
    }@

    The Problem is, that the generating of the Text takes 1.808s
    Heres a Screenshot of the QML-Profiler:
    !http://ngleichauf.de/download/screen.png(Screenshot)!

    How can i fix this issue?

    Thanks

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

      You are asking about initialisation performance: I doubt you can do anything there.

      Please try with changing "renderType":http://qt-project.org/doc/qt-5/qml-qtquick-text.html#renderType-prop property. It can have big impact on runtime performance, although I doubt it will change much in the initialisation time.

      (Z(:^

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fyDe
        wrote on last edited by
        #3

        Oh i forgot to mention that I already tried to set the renderType.
        This Code changes nothing. The Time is 1.811s.

        @import QtQuick 2.2

        Rectangle {
        width: 360
        height: 360
        Text {
        anchors.centerIn: parent
        text: "Hello World"
        renderType: Text.NativeRendering
        antialiasing: false
        smooth: false
        }
        MouseArea {
        anchors.fill: parent
        onClicked: {
        Qt.quit();
        }
        }
        }@

        My sytem is Mac OS X 10.9.2 on on MacBook Pro Retina 2012

        1 Reply Last reply
        0
        • X Offline
          X Offline
          Xander84
          wrote on last edited by
          #4

          Hi, I tried your example on windows and it takes like 20 ms to create the Text element. Still by far the slowest item but nothing compared to your time!?

          !http://i60.tinypic.com/r2kfa8.jpg(qml profiler)!

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fyDe
            wrote on last edited by
            #5

            I just tested it on Windows 7 too.
            The time is 5.2 ms this would be all right. But almost 2 seconds? I don't understand what im doing wrong.

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

              I think there has been reported performance issues in particular when loading the QFontDatabase data at startup, which would have no relation to rendering time. That said I have never heard about performance as bad as this so it might be worth reporting.
              A few points though:

              • make sure you don't compare performance using a debug build
              • if its the font database this should be a one time cost. Consecutive instances for Text would be much faster.
              • the amount of fonts installed might affect the performance. Do you have a lot of fonts installed on the mac?
              1 Reply Last reply
              0
              • F Offline
                F Offline
                fyDe
                wrote on last edited by
                #7

                Thanks for your answer and your hints.
                I think you are right. Further texts do not impact the Time in the way the first does.
                !http://www.ngleichauf.de/download/screen2.png(screenshot)!

                I now don't have any additional fonts installed on my Mac, i ensured it and deleted all the additional fonts i installed.

                The problem is also there if I build the release of the program.

                Also if it is a one time cost to load the font database it takes much to long in my opinion, in which the problem is not there when using windows.

                I use a splash screen at the moment to load the main content in background, but this is only necessary because the first text loads this long.

                Thanks!
                Greets Nico

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  fyDe
                  wrote on last edited by
                  #8

                  Hey,

                  i just installed the 5.3.0 RC.
                  The problem is solved with this release.

                  Thanks!

                  Greets Nico

                  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