Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. CPU Usage going high during user operation
Forum Updated to NodeBB v4.3 + New Features

CPU Usage going high during user operation

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
18 Posts 3 Posters 6.0k Views 2 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
    kumararajas
    wrote on 8 Aug 2016, 10:45 last edited by
    #1

    Hello,

    I did run a test Qt application on my ARM based Embedded plaform.

    Qt application had a simple table, and another one with simple list with pre populated data of about 2000 rows.

    When I scroll the list using the scrollbar, up and down, continuously, I see that CPU is hitting about 70%.

    This looks monstrous because it is not just my application going to run on the system.

    There are other monsters would take 50-60% of CPU.

    So, question is, why Qt embedded application is taking more CPU during the rigorous UI operation.

    My understanding is that, that could be because of parent QWidget's paint (default). How do I make my application lite?

    Thanks,
    Kumara

    --Kumar

    R 1 Reply Last reply 8 Aug 2016, 11:22
    0
    • K kumararajas
      8 Aug 2016, 10:45

      Hello,

      I did run a test Qt application on my ARM based Embedded plaform.

      Qt application had a simple table, and another one with simple list with pre populated data of about 2000 rows.

      When I scroll the list using the scrollbar, up and down, continuously, I see that CPU is hitting about 70%.

      This looks monstrous because it is not just my application going to run on the system.

      There are other monsters would take 50-60% of CPU.

      So, question is, why Qt embedded application is taking more CPU during the rigorous UI operation.

      My understanding is that, that could be because of parent QWidget's paint (default). How do I make my application lite?

      Thanks,
      Kumara

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 8 Aug 2016, 11:22 last edited by
      #2

      @kumararajas said:

      My understanding is that, that could be because of parent QWidget's paint (default). How do I make my application lite?

      First of all you should really pin down the problem. Since performance can be lost almost everywhere.

      You may want to check with a simple test application if this is really a Qt problem. Event the choice of data structure to store your 2000 rows may already influence it.
      And avoid using QStandardItem-Framework when dealing with such an amount of data.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      K 1 Reply Last reply 9 Aug 2016, 12:23
      0
      • R raven-worx
        8 Aug 2016, 11:22

        @kumararajas said:

        My understanding is that, that could be because of parent QWidget's paint (default). How do I make my application lite?

        First of all you should really pin down the problem. Since performance can be lost almost everywhere.

        You may want to check with a simple test application if this is really a Qt problem. Event the choice of data structure to store your 2000 rows may already influence it.
        And avoid using QStandardItem-Framework when dealing with such an amount of data.

        K Offline
        K Offline
        kumararajas
        wrote on 9 Aug 2016, 12:23 last edited by
        #3

        @raven-worx Just to add, I did not write any test application.

        Instead I have used two examples - 1) TI's QML based Playground application 2) Anamoly example.

        Both when scrolling, I see that CPU reaches to 90% as well.

        This is an example application provided by Qt, and that eats the CPU.

        What I should do differently, to optimize the CPU usage?

        Thanks!

        --Kumar

        R 1 Reply Last reply 9 Aug 2016, 12:46
        0
        • K kumararajas
          9 Aug 2016, 12:23

          @raven-worx Just to add, I did not write any test application.

          Instead I have used two examples - 1) TI's QML based Playground application 2) Anamoly example.

          Both when scrolling, I see that CPU reaches to 90% as well.

          This is an example application provided by Qt, and that eats the CPU.

          What I should do differently, to optimize the CPU usage?

          Thanks!

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 9 Aug 2016, 12:46 last edited by
          #4

          @kumararajas
          what are the specs of your ARM system?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          K 1 Reply Last reply 9 Aug 2016, 14:14
          0
          • R raven-worx
            9 Aug 2016, 12:46

            @kumararajas
            what are the specs of your ARM system?

            K Offline
            K Offline
            kumararajas
            wrote on 9 Aug 2016, 14:14 last edited by kumararajas 8 Sept 2016, 14:16
            #5

            @raven-worx My hardware follow similar specs as AM335x EVM

            Fewer Details -

            Up to 1-GHz Sitara™ ARM® Cortex®-A8 32-Bit 
            512MB of RAM
            

            Thanks!

            --Kumar

            K 1 Reply Last reply 10 Aug 2016, 05:47
            0
            • K kumararajas
              9 Aug 2016, 14:14

              @raven-worx My hardware follow similar specs as AM335x EVM

              Fewer Details -

              Up to 1-GHz Sitara™ ARM® Cortex®-A8 32-Bit 
              512MB of RAM
              

              Thanks!

              K Offline
              K Offline
              kumararajas
              wrote on 10 Aug 2016, 05:47 last edited by
              #6

              Adding to this,

              I wrote a simple application, that has a tableview, and it contains 25 rows, prefilled with some data.

              I ran this application on the embedded board.

              On idle state, CPU usage was 0%, occasionally 1%.

              When I scroll down the list slowly, I see that CPU was about 5%, which is a decent score.

              When I scroll up and down the list, rigorously, I see that CPU usage is shooting to 50% or even more.

              What is puzzling me is, this is a simple app, and is that Qt failed to optimize the implementation?

              I am sure, I can do some tricks like, when move the slider, not to update the tableview and update only when slider is released. All those would definitely improve a bit.

              But, these are all part of optimizations.

              A simple tableview code, may be of 20 lines maximum, will end up having 100 lines of code for improving the performance. But, question is, why every Qt user has to implement this 100 lines of code to have efficient implementation? Why not Qt do such implementation by default?

              I know I have poured off plenty of thoughts. (May be feeling pressure here? :P)

              Please let me know your thoughts.

              Thanks!

              Kumara

              --Kumar

              R 1 Reply Last reply 10 Aug 2016, 06:52
              0
              • K kumararajas
                10 Aug 2016, 05:47

                Adding to this,

                I wrote a simple application, that has a tableview, and it contains 25 rows, prefilled with some data.

                I ran this application on the embedded board.

                On idle state, CPU usage was 0%, occasionally 1%.

                When I scroll down the list slowly, I see that CPU was about 5%, which is a decent score.

                When I scroll up and down the list, rigorously, I see that CPU usage is shooting to 50% or even more.

                What is puzzling me is, this is a simple app, and is that Qt failed to optimize the implementation?

                I am sure, I can do some tricks like, when move the slider, not to update the tableview and update only when slider is released. All those would definitely improve a bit.

                But, these are all part of optimizations.

                A simple tableview code, may be of 20 lines maximum, will end up having 100 lines of code for improving the performance. But, question is, why every Qt user has to implement this 100 lines of code to have efficient implementation? Why not Qt do such implementation by default?

                I know I have poured off plenty of thoughts. (May be feeling pressure here? :P)

                Please let me know your thoughts.

                Thanks!

                Kumara

                R Offline
                R Offline
                raven-worx
                Moderators
                wrote on 10 Aug 2016, 06:52 last edited by
                #7

                @kumararajas
                seems like this is something for the devs, so you should post it on the Qt dev mailing list
                If you do so, please keep this post updated for others looking for the same issue.

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kumararajas
                  wrote on 20 Aug 2016, 13:10 last edited by
                  #8

                  Thanks for the response!

                  Can you please also share me the details about Qt dev mailing list?

                  Thanks!

                  --Kumar

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kumararajas
                    wrote on 20 Aug 2016, 13:22 last edited by
                    #9

                    Adding to my experiments,
                    I have created a blank application, dragged up tablewidget and prepopulated about 30 rows. Built the app and ran it on my target.
                    It showed up the scroll bar. I dragged the scroll bar handle up and down continuously.
                    And I saw the CPU shooted up to 61%.

                    Is it the expected behaviour?

                    --Kumar

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      kumararajas
                      wrote on 25 Aug 2016, 07:15 last edited by
                      #10

                      Any further thoughts?

                      Thanks,
                      Kumara

                      --Kumar

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 25 Aug 2016, 20:21 last edited by
                        #11

                        The interest mailing list is followed by the Qt developers/maintainers.

                        You should also benchmark with QTableView and a custom model.

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

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          kumararajas
                          wrote on 26 Aug 2016, 08:12 last edited by
                          #12

                          Yes I did!

                          That's where I have started up. I had QTableView with my own model, that was shooting up the CPU usage, at times, to 99% as well.
                          Then I started to dig in and found that simple application with scrollbar, sample Qt applications also take high CPU.

                          For example, slider example in Qt directory, cross compiled and ran it on the target. When I operate the scroll bar, CPU usage reaches 67% easily.

                          I am thinking if its a bug in scrollbar code?

                          --Kumar

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 26 Aug 2016, 12:03 last edited by
                            #13

                            There might be something sub-optimal going on.

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

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              kumararajas
                              wrote on 7 Nov 2017, 21:08 last edited by kumararajas 11 Jul 2017, 21:08
                              #14

                              This is still an open point. Any thoughts on this?

                              Is it a bug in Qt that on scrolling, it consumes high cpu?

                              I also see a Qt bug report - https://bugreports.qt.io/browse/QTBUG-57550

                              --Kumar

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on 7 Nov 2017, 21:10 last edited by
                                #15

                                With 5.9 / 5.10 ?

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

                                K 1 Reply Last reply 7 Nov 2017, 21:14
                                0
                                • SGaistS SGaist
                                  7 Nov 2017, 21:10

                                  With 5.9 / 5.10 ?

                                  K Offline
                                  K Offline
                                  kumararajas
                                  wrote on 7 Nov 2017, 21:14 last edited by
                                  #16

                                  @SGaist Sam! Neither of that. I am still on ancient age 4.8.7 :)

                                  --Kumar

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 8 Nov 2017, 21:37 last edited by
                                    #17

                                    Do you know at which points is start to slow down ?

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

                                    K 1 Reply Last reply 9 Nov 2017, 19:46
                                    0
                                    • SGaistS SGaist
                                      8 Nov 2017, 21:37

                                      Do you know at which points is start to slow down ?

                                      K Offline
                                      K Offline
                                      kumararajas
                                      wrote on 9 Nov 2017, 19:46 last edited by
                                      #18

                                      @SGaist Just have a decently big project tree, about 50 branches, with 50 children each.
                                      Just press and hold the down arrow in the scroll bar, we can observe that CPU % usage will constantly increment.

                                      In Ubuntu, we can see that it is a gradual increment.

                                      In case of AM335x, we can see that it shoots up to 60%.
                                      One other operation - Just drag the scrollbar handle up and down continuously, Ubuntu can go up to 30%, AM335x can go to 80%.

                                      --Kumar

                                      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