Speed up build time with -jX



  • My system is: Intel Core2Duo P8400@2.26GHz
    RAM: 4GB
    Windows 7 Professioanl 64bits

    I'm building a "big" project and it takes something like 20/30 minutes. A friend of mine said me to use the -jX but doesn't know what are the best number to use in X, can you tell me what could be the better option in my system? I should add the argument in projects > Make arguments, right? And should i add it to qmake too?

    Thanks



  • Usually it's the number of phisical cores that you have (eventually, plus one. Do some benchmarks.)



  • Opinions on this differ, and I guess it also differs if you want to use your system in the meantime. Usual numbers of the value of X include N-1, N, N+1 up to N*2, with N being the number of (virtual) cores in your system. I guess it depends on whether your compilation is going to be IO bound, or CPU bound. If you have an SSD for instance, IO will be much faster, and X should probably be closer to N. If you have your sources on a slow resource, you may spend too much time waiting for them that way though, and X could be bigger than N.

    Downside of using -jX, is that it may beharder to find the cause of compilation failures. The cause may not be at the end, but somewhere in the middle of your compile output.



  • Thanks all :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.