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 kumararajas

    @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 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

    raven-worxR 1 Reply Last reply
    0
    • K kumararajas

      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

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on 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 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 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 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 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 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 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 last edited by kumararajas
                    #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 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
                      0
                      • SGaistS SGaist

                        With 5.9 / 5.10 ?

                        K Offline
                        K Offline
                        kumararajas
                        wrote on 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 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
                          0
                          • SGaistS SGaist

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

                            K Offline
                            K Offline
                            kumararajas
                            wrote on 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