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. High CPU usage
Forum Updated to NodeBB v4.3 + New Features

High CPU usage

Scheduled Pinned Locked Moved Unsolved General and Desktop
27 Posts 8 Posters 6.2k Views 5 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 Ketan__Patel__0011
    21 Sept 2020, 04:47

    @raven-worx

    again if 100% CPU uses at runtime when i perform any operation that time i can deal with it but at compile time it may be problem comes from the compiler or may be my Qt Version is unstable

    ->My Qt Version Is : 5.12.3

    O Offline
    O Offline
    ollarch
    wrote on 21 Sept 2020, 09:13 last edited by
    #16

    @Ketan__Patel__0011
    When you run the application the complier does nothing. It have finished the work and it have generated an executable file.
    Are you sure that the application is not doing anything?
    Could you try to comment the processing library include files and run the application again?

    K 1 Reply Last reply 21 Sept 2020, 09:21
    0
    • J JonB
      21 Sept 2020, 08:54

      @Ketan__Patel__0011
      Your Qt version is probably not relevant. You are reporting the C++ compiler taking a lot of time. And since you say

      i was create one qt application And i Used Some image Processing Library in my application and used it's functions

      I can only guess that your image processing library --- the header files you include from it --- are so "complex" that it just takes the compiler a long time to compile code which includes them.

      Please confirm that if you let it take whatever time it wants your compile/link do complete successfully? In which case I wouldn't worry about it, it is what it is. If on the other hand it fails to come to a successful conclusion, then that would be a different matter....

      K Offline
      K Offline
      Ketan__Patel__0011
      wrote on 21 Sept 2020, 09:15 last edited by
      #17

      @JonB

      Thanks for you reply

      i am used Same Library in Microsoft visual studio 2015 and i create new project in Microsoft visual studio 2015 and i didn't get Any Issus my project Compile Successfully
      and when i start compiling my visual studio c++ project that time my System used less than 20% Of CPU.

      and i think in Qt MSVC 2015 Kit and Microsoft Visual Studio 2015 are used Same Compiler for C++

      O 1 Reply Last reply 21 Sept 2020, 09:30
      0
      • O ollarch
        21 Sept 2020, 09:13

        @Ketan__Patel__0011
        When you run the application the complier does nothing. It have finished the work and it have generated an executable file.
        Are you sure that the application is not doing anything?
        Could you try to comment the processing library include files and run the application again?

        K Offline
        K Offline
        Ketan__Patel__0011
        wrote on 21 Sept 2020, 09:21 last edited by
        #18

        @ollarch

        Thanks for your Reply

        I am faced this problem Many Time ,but i didn't get any solution
        if i used any library or not

        1 Reply Last reply
        0
        • K Ketan__Patel__0011
          21 Sept 2020, 09:15

          @JonB

          Thanks for you reply

          i am used Same Library in Microsoft visual studio 2015 and i create new project in Microsoft visual studio 2015 and i didn't get Any Issus my project Compile Successfully
          and when i start compiling my visual studio c++ project that time my System used less than 20% Of CPU.

          and i think in Qt MSVC 2015 Kit and Microsoft Visual Studio 2015 are used Same Compiler for C++

          O Offline
          O Offline
          ollarch
          wrote on 21 Sept 2020, 09:30 last edited by
          #19

          @Ketan__Patel__0011
          You are mixing compilation times and execution times. Where is your problem? When compiling or when running? And wich is the problem? High CPU usage? When comiling as more CPU used less time to compile and when running it will depend on what is your application doing.
          About faulty applications... If it faults it has a bug so you have to find it and remove it.

          J K 2 Replies Last reply 21 Sept 2020, 09:45
          0
          • O ollarch
            21 Sept 2020, 09:30

            @Ketan__Patel__0011
            You are mixing compilation times and execution times. Where is your problem? When compiling or when running? And wich is the problem? High CPU usage? When comiling as more CPU used less time to compile and when running it will depend on what is your application doing.
            About faulty applications... If it faults it has a bug so you have to find it and remove it.

            J Offline
            J Offline
            JonB
            wrote on 21 Sept 2020, 09:45 last edited by JonB
            #20

            @ollarch
            I believe @Ketan__Patel__0011 has consistently only reported compilation/link timings, I don't see where you see he might be reporting runtime execution time?

            If he says that outside of Qt Creator it compiles with 20% CPU while inside it is 90% that does sound a touch strange.... It looks like it is the Microsoft Compiler Driver which is taking the time....

            O 1 Reply Last reply 21 Sept 2020, 10:44
            0
            • O ollarch
              21 Sept 2020, 09:30

              @Ketan__Patel__0011
              You are mixing compilation times and execution times. Where is your problem? When compiling or when running? And wich is the problem? High CPU usage? When comiling as more CPU used less time to compile and when running it will depend on what is your application doing.
              About faulty applications... If it faults it has a bug so you have to find it and remove it.

              K Offline
              K Offline
              Ketan__Patel__0011
              wrote on 21 Sept 2020, 10:22 last edited by
              #21

              @ollarch

              No i am not talking about execution time

              Capture_2.PNG

              My Problem is High CPU Uses When I start to Build My Project

              And Tell me one think you never faced this problem ?

              1 Reply Last reply
              0
              • J JonB
                21 Sept 2020, 09:45

                @ollarch
                I believe @Ketan__Patel__0011 has consistently only reported compilation/link timings, I don't see where you see he might be reporting runtime execution time?

                If he says that outside of Qt Creator it compiles with 20% CPU while inside it is 90% that does sound a touch strange.... It looks like it is the Microsoft Compiler Driver which is taking the time....

                O Offline
                O Offline
                ollarch
                wrote on 21 Sept 2020, 10:44 last edited by
                #22

                @JonB
                Maybe QtCreator is uning multiprocessor compiling while Visual Studio is not. The Intel i3-3220 has 4 core threads, so 20~25 CPU usage during compilation sounds like only one core is used.
                On Visual Studio check the "C/C++" options , section "All options" parameter "Additional options", and set "/MP4" to it. It will use 4 cores on compilation.

                K 1 Reply Last reply 21 Sept 2020, 11:09
                4
                • O ollarch
                  21 Sept 2020, 10:44

                  @JonB
                  Maybe QtCreator is uning multiprocessor compiling while Visual Studio is not. The Intel i3-3220 has 4 core threads, so 20~25 CPU usage during compilation sounds like only one core is used.
                  On Visual Studio check the "C/C++" options , section "All options" parameter "Additional options", and set "/MP4" to it. It will use 4 cores on compilation.

                  K Offline
                  K Offline
                  Ketan__Patel__0011
                  wrote on 21 Sept 2020, 11:09 last edited by
                  #23

                  @ollarch

                  Thanks for your reply and your suggestion

                  i will try your idea But I am not developing Software in visual studio.
                  i am developing software in QT, currently am working on this problem.
                  doesn't matter why Microsoft visual studio 2015 not use more than 20-25% of CPU

                  My higher priority is to solve this problem in QT

                  or If you get any other idea or any other solution for it than please drop your answer or suggestion here
                  Again Thanks You So Much

                  1 Reply Last reply
                  0
                  • O Offline
                    O Offline
                    ollarch
                    wrote on 21 Sept 2020, 11:14 last edited by
                    #24

                    I think that as the othre users suggest you, this is not a problem. QtCreateor is using all CPUs to reduce compilation time. It's the expected behaviour.

                    K 1 Reply Last reply 21 Sept 2020, 11:20
                    0
                    • O ollarch
                      21 Sept 2020, 11:14

                      I think that as the othre users suggest you, this is not a problem. QtCreateor is using all CPUs to reduce compilation time. It's the expected behaviour.

                      K Offline
                      K Offline
                      Ketan__Patel__0011
                      wrote on 21 Sept 2020, 11:20 last edited by
                      #25

                      @ollarch

                      Thanks For You Reply

                      Is there Any Mention in any QT Documentation or any other where ?

                      B 1 Reply Last reply 21 Sept 2020, 11:39
                      0
                      • K Ketan__Patel__0011
                        21 Sept 2020, 11:20

                        @ollarch

                        Thanks For You Reply

                        Is there Any Mention in any QT Documentation or any other where ?

                        B Offline
                        B Offline
                        Bonnie
                        wrote on 21 Sept 2020, 11:39 last edited by
                        #26

                        @Ketan__Patel__0011
                        For MSVC builds, Qt uses jom instead of nmake, to build in parallel, use more CPU and speed up the building.
                        You can refer to:
                        https://wiki.qt.io/Jom
                        https://www.qt.io/blog/2009/03/27/speeding-up-visual-c-qt-builds

                        A 1 Reply Last reply 21 Sept 2020, 15:21
                        3
                        • J Offline
                          J Offline
                          JKSH
                          Moderators
                          wrote on 22 Sept 2020, 02:49 last edited by
                          #27

                          (Side discussion forked to https://forum.qt.io/topic/119207/relationships-between-qmake-make-nmake-jom-and-the-compiler )

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

                          1 Reply Last reply
                          3

                          25/27

                          21 Sept 2020, 11:20

                          • Login

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