Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator & Jom: Slow compile on a high-end desktop
Qt 6.11 is out! See what's new in the release blog

QtCreator & Jom: Slow compile on a high-end desktop

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 4 Posters 8.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.
  • M Offline
    M Offline
    marcus.fr
    wrote on last edited by
    #1

    Hi

    I have bought new desktop with specs below to improve compile time.
    Processor: Intel Sandy Bridge-E I7-3930K, 3.20GHz, 6 Cores, 12 Threads, 12MB Cache, 64bit, DDR3-1600MHz, Socket 2011
    Memory: Corsair 16GB DDR3, 2133MHz
    SSD Disk: Kingston 240GB SSDNow HyperX SATA 6.0Gb/s

    Running on Windows 7 64bit, QtSDK 1.2.1 with Jom setup for build steps and MSVC 2010 x86 compiler. My project links against parts of Boost library (headers only), Qt libs are dynamically linked and I have only one main cpp file. Compile time is around 40s. I placed the whole project on RAM Disk but speed improved only by 1 sec. The CPU usage (all 6 cores combined) during compilation is ONLY 8%.

    I expected much faster compile speed compared to Dual Core 1.8GHz, 1.5GB RAM machine. Is there anything I can configure to improve the speed? I suspect that the CPU is not really utilized.

    Thanks

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      How many cpp files are there in total to be build?

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #3

        If you only have one cpp file then only one core will be used. Linking is still single threaded too I think. Try breaking your one large cpp file into smaller compilation units. That should speed up compilation but you will still be limited by link time.

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply
        0
        • M Offline
          M Offline
          marcus.fr
          wrote on last edited by
          #4

          [quote author="Tobias Hunger" date="1351863907"]How many cpp files are there in total to be build?[/quote]

          It has only one cpp file, that is "main.cpp" with about 10000 lines. There are small project's header files and boost headers (.hpp) files. Qt lib DLLs are dynamically linked.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            marcus.fr
            wrote on last edited by
            #5

            [quote author="ZapB" date="1351865052"]If you only have one cpp file then only one core will be used. Linking is still single threaded too I think. Try breaking your one large cpp file into smaller compilation units. That should speed up compilation but you will still be limited by link time.[/quote]

            I was hoping that breaking the code into more cpp files will not be necessary :(

            1 Reply Last reply
            0
            • M Offline
              M Offline
              marcus.fr
              wrote on last edited by
              #6

              [quote author="ZapB" date="1351865052"]If you only have one cpp file then only one core will be used...[/quote]

              Any workaround to make it work with single cpp file?

              1 Reply Last reply
              0
              • K Offline
                K Offline
                koahnig
                wrote on last edited by
                #7

                [quote author="Marcus Frenkel" date="1351874922"][quote author="ZapB" date="1351865052"]If you only have one cpp file then only one core will be used...[/quote]

                Any workaround to make it work with single cpp file?
                [/quote]
                No, if you have only a single file AFAIK it has to be compiled in one run. You would need a special multi-threaded compiler. The best way to do so is having different modules which require only short compile runs each.
                Jom basically starts several compiler instances in parallel. That brings the speed.
                Moreover, you should really consider breaking up your code into several modules. The different makes are supporting to have partial compilation of the code by checking which files have been changed.
                Without using jom you would have already a speedup of compilation.

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  marcus.fr
                  wrote on last edited by
                  #8

                  [quote author="koahnig" date="1351875981"][quote author="Marcus Frenkel" date="1351874922"][quote author="ZapB" date="1351865052"]If you only have one cpp file then only one core will be used...[/quote]

                  Any workaround to make it work with single cpp file?
                  [/quote]
                  No, if you have only a single file AFAIK it has to be compiled in one run. You would need a special multi-threaded compiler. The best way to do so is having different modules which require only short compile runs each.
                  Jom basically starts several compiler instances in parallel. That brings the speed.
                  Moreover, you should really consider breaking up your code into several modules. The different makes are supporting to have partial compilation of the code by checking which files have been changed.
                  Without using jom you would have already a speedup of compilation.
                  [/quote]

                  I broke up the code into more CPP files. I found out that the most time consuming part is linking the boost library. So I couldn't get any improvement because it is only one class that uses the boost library (small code in my project but loads many boost's headers). I ended up using pre-compiled headers for boost and now the compile speed is good enough.

                  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