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. Performance difference (Qt4 vs Qt5)
Forum Updated to NodeBB v4.3 + New Features

Performance difference (Qt4 vs Qt5)

Scheduled Pinned Locked Moved The Lounge
18 Posts 6 Posters 27.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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #2

    Raster engine has not been removed. All Qt5 does is to add another possibility: SceneGraph.

    (Z(:^

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

      I did a quick run with "qtperf":http://code.google.com/p/qtperf/ (which basically tests the QtGui / QtWidgets module and therefore the native / raster paint engine) and it shows a performance gain of Qt 5.0.1 over Qt 4.8.4 of ~23,2% (so Qt5 is roughly a quarter faster then Qt4).

      The QtQuick drawing backend in Qt5, the scenegraph, cleary "outperforms":http://blog.qt.digia.com/blog/2011/05/31/qml-scene-graph-in-master/ the native / raster paint engine.

      Qt comes with quite an extensive set of benchmarks, so feel free to do you own benchmarking for your target platform if you are in doubt.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        migizi
        wrote on last edited by
        #4

        Good to know. The people on the mailining lists (for the projects that use Qt) were complaining that Qt 5 was slower because the native graphics option was removed and forced you to use raster. I haven't been able to keep up with Qt 5 as much as I like so I didn't know about the scenegraph. I'll mention this on the mailing lists. It seems to be a reason some of the project don't want to migrate from Qt4 to 5.

        1 Reply Last reply
        0
        • W Offline
          W Offline
          Welshman
          wrote on last edited by
          #5

          I have just migrated my project of a simple moving dial using QML and there is
          a reduction in performance in Qt5

          The needle jitters as it moves, smooth in Qt4

          The QML is launched using QQuickview in QT5

          Qdeclarativeview in QT4

          How can I fix the QT5 issue ?

          ...just realised this post is a year old not a few days

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

            In Qt5, you can tell QtQuick to offload to a different thread. But treat that as a last resort - I think the problem lies somewhere else. What are the changes in your QML for Qt5? Maybe your code is suboptimal, or you are running on Mesa drivers? Are you using the newest version (Qt 5.2.0)?

            (Z(:^

            1 Reply Last reply
            0
            • W Offline
              W Offline
              Welshman
              wrote on last edited by
              #7

              Thanks for picking this up

              Only changed

              import QtQuick 1.0

              to

              import QtQuick 2.0

              This is the moving element in qml

              @
              Image {
              id: needle2
              x: 678; y: 107
              smooth: true
              source: "needle.png"
              transform: Rotation {
              id: needle2Rotation
              origin.x: 17.5; origin.y:151
              //! [needle angle]
              angle: Math.min(Math.max(-60, root2.value*1.215 - 60), 200)

                              Behavior on angle {
                                  SpringAnimation {
                                      spring: 1.4
                                      damping:.15
                                  }
                              }
              }
              }
              

              @

              I see the same QT4 to QT5 difference in Windows and Linux
              Linux is my main development platform

              The OpenGL example apps run fine

              Im running 5.2

              The qml code above is the dial with slider example shipped with QT4.8 (its not in QT5)

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

                Please edit your post and wrap the code between '@' tags: it will be much easier to read.

                I can recognize the code, yes. In Qt 5.2, you can actually bump the import to:
                @
                import QtQuick 2.1 // or maybe even 2.2, I'm not sure
                @

                Maybe you are indeed on to something wrong in Qt itself: it should be running smoothly.

                (Z(:^

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  nezticle
                  wrote on last edited by
                  #9

                  Regarding Performance differences between Qt 4 and Qt 5, as always it depends on your use case. In the Widget stack, I would expect painting performance between 4.8 and 5.0 to be very similar. In 4.8 we deprecated the "native" painting in favour of raster, and in Qt 5 almost any use of QPainter will result in the use of the raster paint engine (except for a few cases where you will us the OpenGL paint engine instead).

                  For the QML cases, QtQuick 1.x -> QtQuick 2.x will almost always be more performant in Qt 5 vs Qt 4. Here for the majority of cases (except for QQuickPaintedItem) we'll be rendering your scene in OpenGL and avoiding the QPainter abstraction all together.

                  There are of course other factors than painting/rendering performance at play when discussing comparisons between Qt 4 and Qt 5, but in the case of graphics performance Qt 5 should be equal to or better than in Qt 4.

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    Welshman
                    wrote on last edited by
                    #10

                    QtQuick 2.1 and 2.2 had the same results

                    UI Componenets Dial Control Example in Qt 4.8
                    ported to Qt5.2

                    if its just me seeing the degraded dial movement then I need to see what im doing different, im not an experienced Qt programmer ,Qt is my first C++ experience after using C in embedded products.

                    1 Reply Last reply
                    0
                    • W Offline
                      W Offline
                      Welshman
                      wrote on last edited by
                      #11

                      Looking closer this dial control QML is in Qt5 install

                      it doesn't appear in the welcome page of examples , but it does sit in the Qt5 install directory , all the porting changes already done.

                      I loaded ready ported qml with the same problem.

                      running Qt4 dialcontrol and Qt5 dialcontrol side by side on the same monitor will show the obvious difference

                      1 Reply Last reply
                      0
                      • JKSHJ Offline
                        JKSHJ Offline
                        JKSH
                        Moderators
                        wrote on last edited by
                        #12

                        Hi,

                        How did you run the example? I opened <Qt>/examples/declarative/ui-components/dialcontrol/dialcontrol.pro in Qt Creator, built it and ran it. It was perfectly smooth for me -- MSVC 2012 x64, OpenGL. (Although, I'm using a gaming PC with a powerful graphics card).

                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                        1 Reply Last reply
                        0
                        • W Offline
                          W Offline
                          Welshman
                          wrote on last edited by
                          #13

                          I think thats the Qt4 version using QtQuick 1.0

                          there is another in C:\Qt\Qt5.2.0\5.2.0\Src\qtdeclarative\examples\quick\ui-components\dialcontrol

                          1 Reply Last reply
                          0
                          • JKSHJ Offline
                            JKSHJ Offline
                            JKSH
                            Moderators
                            wrote on last edited by
                            #14

                            Ah, you're right. Anyway, I ran both versions, and here are the results:

                            If I drag the slider from one end to the other, both versions are equally (very) smooth.

                            If I drag the slider really slowly across, then the Qt Quick 2 version is a bit jerkier.

                            I'm guessing that you saw the effects of trial #2? I think the degradation here is due to how the QML engine delivers bound values to Behavior/SpringAnimation, not due to slower graphics performace. If graphics were degraded, then you'd see the jerkiness in trial #1 too.

                            Also, if you delete the "Behavior on angle" part in Dial.qml, you'll find that the graphics updates are really snappy.

                            Nonetheless, it's still a degradation from Qt Quick 1. Would you like to report it to http://bugreports.qt-project.org/ ?

                            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                            1 Reply Last reply
                            0
                            • W Offline
                              W Offline
                              Welshman
                              wrote on last edited by
                              #15

                              Thanks

                              And yes it is test 2. slow movements , initial acceleration i would say is jerky

                              Yes I would like to report it, never reported a bug before tho

                              1 Reply Last reply
                              0
                              • JKSHJ Offline
                                JKSHJ Offline
                                JKSH
                                Moderators
                                wrote on last edited by
                                #16

                                Go to http://bugreports.qt-project.org/

                                Create an account and log in

                                Click "Create Issue" (top-right)

                                Enter the following, plus your own details:

                                Project: Qt

                                Issue Type: Bug

                                Component/s: QtQuick: Core

                                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                1 Reply Last reply
                                0
                                • W Offline
                                  W Offline
                                  Welshman
                                  wrote on last edited by
                                  #17

                                  Bug posted,

                                  QTBUG-36709

                                  thanks guys for all your help

                                  1 Reply Last reply
                                  0
                                  • JKSHJ Offline
                                    JKSHJ Offline
                                    JKSH
                                    Moderators
                                    wrote on last edited by
                                    #18

                                    Thank you for your report!

                                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                    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