Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Performace Problem with Text

    QML and Qt Quick
    4
    8
    1699
    Loading More Posts
    • 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
      fyDe last edited by

      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 Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        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 Reply Quote 0
        • F
          fyDe last edited by

          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 Reply Quote 0
          • X
            Xander84 last edited by

            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 Reply Quote 0
            • F
              fyDe last edited by

              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 Reply Quote 0
              • J
                Jens last edited by

                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 Reply Quote 0
                • F
                  fyDe last edited by

                  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 Reply Quote 0
                  • F
                    fyDe last edited by

                    Hey,

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

                    Thanks!

                    Greets Nico

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post