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. Rendering performance problems on iMac with Retina 5K

Rendering performance problems on iMac with Retina 5K

Scheduled Pinned Locked Moved General and Desktop
qgraphicsviewmacretinaperformancerendering
29 Posts 9 Posters 17.3k 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.
  • M Offline
    M Offline
    mrjj
    Lifetime Qt Champion
    wrote on 12 Oct 2015, 06:38 last edited by
    #4

    Ok super , so now we know its not just because its 5k.

    I tried your code on my laptop with win 7.
    At 1920x1080 (maximized), I ran around 60 fps.
    So maybe win 10 has better driver / does something different.

    You could time different pieces of the code to pinpoint where it takes much longer on mac.
    One operation that can be expensive is the QImage to Pixmap convert
    (QPixmap::fromImage) but still such HUGE different is indeed odd.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      PetrM
      wrote on 13 Oct 2015, 06:04 last edited by PetrM
      #5

      New observations:

      • The problem appears on MacBooks with Retina displays (<5k) as well (slow framerate, slow GUI response).
      • On MacBooks with "normal" (no Retina, 1440x900) display the the framerate is also significantly slower under Mac comparing to Windows => It is not a Retina problem but the problem either of Mac OS X itself or the Qt implementation on Mac.

      Some particular times:

      Method | Win10[ms] | Mac[ms]
      QGraphicsView::paintEvent() | 4-6 | 4-6
      QPixmap::fromImage() | <1 | <1
      QTimer::singleShot(1…) timeout | 7-9 | 40-50 *)

      *)
      As for the QTimer::singleShot()... It is very strange. If the window is maximized (under Mac), the timeout is 40-50ms, but if the windows is small then the timeout is significantly lesser (2ms for example). On Windows the timer varies from <1ms to 7ms depending on the window size. The timer type was Qt::PreciseTimer.

      I wonder how the QTimer::singleShot() works. And how the application process other GUI events while the timer is running? My observation is (as I already have written) that the GUI responsivity is significantly slower under Mac comparing to Windows even if the framerate is much more better under Windows. I have to look into the source codes...

      S 1 Reply Last reply 23 Nov 2016, 16:54
      0
      • P PetrM
        13 Oct 2015, 06:04

        New observations:

        • The problem appears on MacBooks with Retina displays (<5k) as well (slow framerate, slow GUI response).
        • On MacBooks with "normal" (no Retina, 1440x900) display the the framerate is also significantly slower under Mac comparing to Windows => It is not a Retina problem but the problem either of Mac OS X itself or the Qt implementation on Mac.

        Some particular times:

        Method | Win10[ms] | Mac[ms]
        QGraphicsView::paintEvent() | 4-6 | 4-6
        QPixmap::fromImage() | <1 | <1
        QTimer::singleShot(1…) timeout | 7-9 | 40-50 *)

        *)
        As for the QTimer::singleShot()... It is very strange. If the window is maximized (under Mac), the timeout is 40-50ms, but if the windows is small then the timeout is significantly lesser (2ms for example). On Windows the timer varies from <1ms to 7ms depending on the window size. The timer type was Qt::PreciseTimer.

        I wonder how the QTimer::singleShot() works. And how the application process other GUI events while the timer is running? My observation is (as I already have written) that the GUI responsivity is significantly slower under Mac comparing to Windows even if the framerate is much more better under Windows. I have to look into the source codes...

        S Offline
        S Offline
        ShikiSuen
        wrote on 23 Nov 2016, 16:54 last edited by ShikiSuen
        #6

        @PetrM Looks like no one wants to solve this problem during recent years. I waited since 2013 and all Steinberg products (they use Qt) are having really bad video performances on macOS under HiDPI mode (not so bad with Dorico due to their optimization, and they are still working on this to make it better. Still, Qt needs to do something).

        Meanwhile, PreSonus wrote their own cross-platform framework and their apps runs at 60fps on macOS under HiDPI mode.

        I am not blaming Steinberg because their limited developer resources are supposed to be dedicated to the audio functionality of their apps. Nevertheless, Steinberg is definitely not the only victim of Qt's lack of fully-powered macOS HiDPI video acceleration support.

        In your case, it needs to be addressed that Qt is not your only choice. I don't know how Xamarin (Visual Studio for Mac, available now) performs, but you may want to try.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 23 Nov 2016, 21:53 last edited by
          #7

          @ShikiSuen It's a bit quick to say that no ones wants to solve the problem. High DPI support has improved since @PetrM wrote this post. And work is currently going on on the subject.

          Also there have been several releases of Qt done in between. You can't blame Qt based on software editor products not working as you want/expect without a least checking wether they are running an up to date version of Qt with they product.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply 24 Nov 2016, 06:38
          0
          • S SGaist
            23 Nov 2016, 21:53

            @ShikiSuen It's a bit quick to say that no ones wants to solve the problem. High DPI support has improved since @PetrM wrote this post. And work is currently going on on the subject.

            Also there have been several releases of Qt done in between. You can't blame Qt based on software editor products not working as you want/expect without a least checking wether they are running an up to date version of Qt with they product.

            S Offline
            S Offline
            ShikiSuen
            wrote on 24 Nov 2016, 06:38 last edited by ShikiSuen
            #8

            @SGaist said in Rendering performance problems on iMac with Retina 5K:

            @ShikiSuen It's a bit quick to say that no ones wants to solve the problem. High DPI support has improved since @PetrM wrote this post. And work is currently going on on the subject.

            Also there have been several releases of Qt done in between. You can't blame Qt based on software editor products not working as you want/expect without a least checking wether they are running an up to date version of Qt with they product.

            Thanks for your reply with your most-recent information. I already send the link of this thread to some people in Steinberg and MakeMusic (Finale), and they may come here to read your information. I do apologize for my too-quick words caused by my 4-years waiting for HiDPI video performance improvements of Steinberg Cubase and MakeMusic Finale, this drove me sick.

            I would better post a screenshot using Cubase 8.5 under macOS Sierra (running on a compatible PC), Low DPI 1600x900 using Geforce GTX 950 (better than the AMD M395X shipped with iMac 5k). The screenshot (Quartz Debug running at the bottom right of the screen) indicates: 1) Cubase using Qt could not fully occupy the graphics to keep 60fps; 2) The performance meter at the bottom left of the screen indicates that this is not CPU bottleneck. // You could think of the deducted performance on a 5k display w/ macOS HiDPI mode.

            alt text

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 24 Nov 2016, 13:28 last edited by
              #9

              Something's not clear from your description: what do you mean by "compatible PC" ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              S 1 Reply Last reply 24 Nov 2016, 14:52
              0
              • S SGaist
                24 Nov 2016, 13:28

                Something's not clear from your description: what do you mean by "compatible PC" ?

                S Offline
                S Offline
                ShikiSuen
                wrote on 24 Nov 2016, 14:52 last edited by
                #10

                @SGaist That's a hackintosh (only in such case I could use a Geforce GTX 950 on macOS with NVidia official web driver). I also have a real retina MacBook Pro (early-2015) with me and the fps on it is far more terrible.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 24 Nov 2016, 15:58 last edited by
                  #11
                  • And how the application process other GUI events while the timer is running?

                  well that normally happens via the exec() for the Application object as normally seen in main.cpp.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    ShikiSuen
                    wrote on 24 Nov 2016, 16:46 last edited by ShikiSuen
                    #12

                    Further tests I did proved that what @SGaist said is right. Steinberg Dorico 1.0.0 (my purchased copy) may occupied later versions of Qt and it could be 60fps under Retina HiDPI mode (Intel Iris Graphics only, MacBook Pro early-2015 13-inch) while scrolling sheetmusic pages only. If resizing window or zooming score pages, there is an FPS bottleneck choking the FPS at maximum 29~30fps. AFAIK, according to what Daniel Spreadbury announced through certain online communities, Dorico team is now dedicating to the UI responsiveness optimization for future Dorico updates. Now I am wondering whether the current version of Qt supports Metal.

                    M 1 Reply Last reply 24 Nov 2016, 17:12
                    0
                    • S ShikiSuen
                      24 Nov 2016, 16:46

                      Further tests I did proved that what @SGaist said is right. Steinberg Dorico 1.0.0 (my purchased copy) may occupied later versions of Qt and it could be 60fps under Retina HiDPI mode (Intel Iris Graphics only, MacBook Pro early-2015 13-inch) while scrolling sheetmusic pages only. If resizing window or zooming score pages, there is an FPS bottleneck choking the FPS at maximum 29~30fps. AFAIK, according to what Daniel Spreadbury announced through certain online communities, Dorico team is now dedicating to the UI responsiveness optimization for future Dorico updates. Now I am wondering whether the current version of Qt supports Metal.

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 24 Nov 2016, 17:12 last edited by
                      #13

                      @ShikiSuen said in Rendering performance problems on iMac with Retina 5K:

                      Metal

                      https://forum.qt.io/topic/42356/qt-and-apple-s-metal

                      As far as I know it do not.
                      Just as it do not support (directly) DirectX and other OS bound techs.

                      Also 4K+ screens are not that common yet.
                      https://www.w3counter.com/globalstats.php
                      so Im not sure getting Metal support has high focus. (purely guessing)
                      But note that hi-res support have gotten some love and improved a lot.

                      S 1 Reply Last reply 24 Nov 2016, 19:03
                      0
                      • M mrjj
                        24 Nov 2016, 17:12

                        @ShikiSuen said in Rendering performance problems on iMac with Retina 5K:

                        Metal

                        https://forum.qt.io/topic/42356/qt-and-apple-s-metal

                        As far as I know it do not.
                        Just as it do not support (directly) DirectX and other OS bound techs.

                        Also 4K+ screens are not that common yet.
                        https://www.w3counter.com/globalstats.php
                        so Im not sure getting Metal support has high focus. (purely guessing)
                        But note that hi-res support have gotten some love and improved a lot.

                        S Offline
                        S Offline
                        ShikiSuen
                        wrote on 24 Nov 2016, 19:03 last edited by ShikiSuen
                        #14

                        @mrjj said in Rendering performance problems on iMac with Retina 5K:

                        @ShikiSuen said in Rendering performance problems on iMac with Retina 5K:

                        Metal

                        https://forum.qt.io/topic/42356/qt-and-apple-s-metal

                        As far as I know it do not.
                        Just as it do not support (directly) DirectX and other OS bound techs.

                        Also 4K+ screens are not that common yet.
                        https://www.w3counter.com/globalstats.php
                        so Im not sure getting Metal support has high focus. (purely guessing)
                        But note that hi-res support have gotten some love and improved a lot.

                        Thanks. Looks like my suggestion of using Xamarin in lieu of Qt still makes sense at this moment:
                        https://developer.xamarin.com/guides/mac/platform-features/introduction-to-macos-sierra/
                        Note that Apple is phasing out their non-retina models. Graphic acceleration efficiency necessities on Retina MacBook Pro models and Retina iMac models are the same. Qt is already 4 years late for this and has no reason to refer the global stats (because they count windows computers) for reasons of postponing Metal support for macOS.

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          ShikiSuen
                          wrote on 6 Dec 2016, 06:59 last edited by
                          #15

                          Update: @mrjj did not tell me anything regarding the difference between Qt QML and Qt Widgets.

                          Thanks to some answers from experts on Zhihu. Now the reason of the performance issue has been found out: Qt Widgets is a deprecated approach which never consults GPU for UI graphic manipulation.

                          The solution is simple: Use Qt Quick + QML instead.

                          M V 2 Replies Last reply 6 Dec 2016, 07:25
                          0
                          • S ShikiSuen
                            6 Dec 2016, 06:59

                            Update: @mrjj did not tell me anything regarding the difference between Qt QML and Qt Widgets.

                            Thanks to some answers from experts on Zhihu. Now the reason of the performance issue has been found out: Qt Widgets is a deprecated approach which never consults GPU for UI graphic manipulation.

                            The solution is simple: Use Qt Quick + QML instead.

                            M Offline
                            M Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on 6 Dec 2016, 07:25 last edited by
                            #16

                            @ShikiSuen
                            Super.
                            QML is not intended for heavy calculations so for that kind of program you will need
                            Qt Quick + QML instead + C++ backend.

                            1 Reply Last reply
                            1
                            • D Offline
                              D Offline
                              DmitryGrig
                              wrote on 11 Mar 2017, 15:25 last edited by
                              #17

                              Hi PetrM.
                              Please update the link to your "working example" - it reports "File Not Found" now.
                              I'd like to reproduce your results on my MacBook.

                              P 1 Reply Last reply 11 Mar 2017, 19:27
                              0
                              • D DmitryGrig
                                11 Mar 2017, 15:25

                                Hi PetrM.
                                Please update the link to your "working example" - it reports "File Not Found" now.
                                I'd like to reproduce your results on my MacBook.

                                P Offline
                                P Offline
                                PetrM
                                wrote on 11 Mar 2017, 19:27 last edited by PetrM 3 Nov 2017, 19:29
                                #18

                                @DmitryGrig
                                The link above is working now. Or just click here.

                                1 Reply Last reply
                                0
                                • S ShikiSuen
                                  6 Dec 2016, 06:59

                                  Update: @mrjj did not tell me anything regarding the difference between Qt QML and Qt Widgets.

                                  Thanks to some answers from experts on Zhihu. Now the reason of the performance issue has been found out: Qt Widgets is a deprecated approach which never consults GPU for UI graphic manipulation.

                                  The solution is simple: Use Qt Quick + QML instead.

                                  V Offline
                                  V Offline
                                  Vadi2
                                  wrote on 11 Mar 2017, 20:57 last edited by
                                  #19

                                  @ShikiSuen said in Rendering performance problems on iMac with Retina 5K:

                                  Update: @mrjj did not tell me anything regarding the difference between Qt QML and Qt Widgets.

                                  Thanks to some answers from experts on Zhihu. Now the reason of the performance issue has been found out: Qt Widgets is a deprecated approach which never consults GPU for UI graphic manipulation.

                                  The solution is simple: Use Qt Quick + QML instead.

                                  You can't be serious. That's equivalent to tearing down your house and rebuilding it from the foundation. That's not a "simple" solution.


                                  I too have experienced QWidgets - in my case with QLabel poor rendering performance, and strangely enough, Hackintosh in Virtual box runs faster than better specced native hardware.

                                  1 Reply Last reply
                                  0
                                  • J Offline
                                    J Offline
                                    jcelerier
                                    wrote on 20 Jun 2017, 08:30 last edited by
                                    #20

                                    @mrjj @ShikiSuen there is a real performance problem not with QWidgets, but with QWidgets's macOS implementation. I'm dual booting macOS/Linux on a retina macbook, and all the QWidgets applications I use, QtCreator, Clementine, Wireshark, (and the ones I develop) are much more fluid and smooth under Linux than MacOS even though it's the same hardware and screen resolution.

                                    M 1 Reply Last reply 20 Jun 2017, 08:49
                                    0
                                    • J jcelerier
                                      20 Jun 2017, 08:30

                                      @mrjj @ShikiSuen there is a real performance problem not with QWidgets, but with QWidgets's macOS implementation. I'm dual booting macOS/Linux on a retina macbook, and all the QWidgets applications I use, QtCreator, Clementine, Wireshark, (and the ones I develop) are much more fluid and smooth under Linux than MacOS even though it's the same hardware and screen resolution.

                                      M Offline
                                      M Offline
                                      mrjj
                                      Lifetime Qt Champion
                                      wrote on 20 Jun 2017, 08:49 last edited by
                                      #21

                                      @jcelerier
                                      What resolution was it ?

                                      J 1 Reply Last reply 24 Aug 2017, 15:35
                                      0
                                      • M mrjj
                                        20 Jun 2017, 08:49

                                        @jcelerier
                                        What resolution was it ?

                                        J Offline
                                        J Offline
                                        jcelerier
                                        wrote on 24 Aug 2017, 15:35 last edited by
                                        #22

                                        @mrjj (sorry for the long response, didn't get any mail notification)

                                        I'm on 2880*1800 resolution.

                                        1 Reply Last reply
                                        0
                                        • J Offline
                                          J Offline
                                          jcelerier
                                          wrote on 24 Aug 2017, 15:40 last edited by jcelerier
                                          #23

                                          If anyone's interested I did a pass through Xcode's performance tools and put the trace here :

                                          https://bugreports.qt.io/browse/QTBUG-61384?focusedCommentId=361794&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-361794

                                          as you can see, roughly 25% of the time is spent in CGContextDrawImage. This was with QtCreator, but I have similar findings when benchmarking my app.

                                          S 1 Reply Last reply 20 Feb 2018, 22:36
                                          1

                                          • Login

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