XCode Compiling Threads

  • Quick question how can I increase the number of compiling threads of
    XCode, I can't seems to find this option in the preference, Im on a
    MBP so I got 2 compiling threads by default but I check a MacPro
    (which got 8 CPU) and it got 8 compiling threads... Is there anyway
    that I can configure more compiling thread within XCode?

    Tks in advance,

    Cheers,
  • On Jan 18, 2009, at 5:38 PM, Romain Marucchi-Foino wrote:

    > Quick question how can I increase the number of compiling threads of
    > XCode, I can't seems to find this option in the preference, Im on a
    > MBP so I got 2 compiling threads by default but I check a MacPro
    > (which got 8 CPU) and it got 8 compiling threads... Is there anyway
    > that I can configure more compiling thread within XCode?

    In order to provide the appropriate answer I think that it would help
    if we knew why you want to change it from the default?

    j o a r
  • Hummmm why do you think?

    Of course to speed up the compilation process...?!?!?!?

    On Jan 19, 2009, at 10:10 AM, j o a r wrote:

    >
    > On Jan 18, 2009, at 5:38 PM, Romain Marucchi-Foino wrote:
    >
    >> Quick question how can I increase the number of compiling threads
    >> of XCode, I can't seems to find this option in the preference, Im
    >> on a MBP so I got 2 compiling threads by default but I check a
    >> MacPro (which got 8 CPU) and it got 8 compiling threads... Is there
    >> anyway that I can configure more compiling thread within XCode?
    >
    >
    > In order to provide the appropriate answer I think that it would
    > help if we knew why you want to change it from the default?
    >
    > j o a r
    >
    >
  • On Jan 18, 2009, at 6:21 PM, Romain Marucchi-Foino wrote:

    > Hummmm why do you think?
    > Of course to speed up the compilation process...?!?!?!?

    I guess my question was if you had any specific reasons to believe
    that more compile jobs would lead to improved build times for your
    particular project?

    Google for "PBXNumberOfParallelBuildSubtasks".

    Note that it's somewhat "dangerous" to override the default automatic
    behavior with a static value. The value that you choose might be
    appropriate for some particular project, on some particular machine,
    but what if any one of those parameter changes?

    j o a r
  • Allright for those who want to do this also:

    1. Open Terminal
    2. defaults write com.apple.Xcode PBXNumberOfParallelBuildSubtasks 4

    Change the value (in this case 4) for any other # that you want...

    Hope this help,

    Cheers,

    On Jan 19, 2009, at 10:41 AM, j o a r wrote:

    >
    > On Jan 18, 2009, at 6:21 PM, Romain Marucchi-Foino wrote:
    >
    >> Hummmm why do you think?
    >> Of course to speed up the compilation process...?!?!?!?
    >
    >
    > I guess my question was if you had any specific reasons to believe
    > that more compile jobs would lead to improved build times for your
    > particular project?
    >
    > Google for "PBXNumberOfParallelBuildSubtasks".
    >
    > Note that it's somewhat "dangerous" to override the default
    > automatic behavior with a static value. The value that you choose
    > might be appropriate for some particular project, on some particular
    > machine, but what if any one of those parameter changes?
    >
    >
    > j o a r
    >
    >
  • On Sun, Jan 18, 2009 at 6:21 PM, Romain Marucchi-Foino
    <romain.marucchi...> wrote:
    > Hummmm why do you think?
    >
    > Of course to speed up the compilation process...?!?!?!?

    Beware, you may actually end up slowing the process down. Xcode does
    its best to adjust the number of subtasks to match not only the number
    of CPUs in your machine, but also the amount of RAM available.

    --
    Clark S. Cox III
    <clarkcox3...>
  • >>
    > Beware, you may actually end up slowing the process down. Xcode does
    > its best to adjust the number of subtasks to match not only the number
    > of CPUs in your machine, but also the amount of RAM available.

    Considering what XCode actually does, I would guess that is about right.
    One process per core for most things is actually pretty close to
    optimum.
  • On Mon, Jan 19, 2009 at 2:52 PM, Clark Cox <clarkcox3...> wrote:
    > On Sun, Jan 18, 2009 at 6:21 PM, Romain Marucchi-Foino
    > <romain.marucchi...> wrote:
    >> Hummmm why do you think?
    >>
    >> Of course to speed up the compilation process...?!?!?!?
    >
    > Beware, you may actually end up slowing the process down. Xcode does
    > its best to adjust the number of subtasks to match not only the number
    > of CPUs in your machine, but also the amount of RAM available.

    Out of interest, does it take account of the fact that compilation
    might not be CPU bound and thus increase the number of threads (i.e.
    beyond the number of CPU cores)?

    -- Chris
  • On Jan 18, 2009, at 6:21 PM, Romain Marucchi-Foino wrote:
    > Hummmm why do you think?
    >
    > Of course to speed up the compilation process...?!?!?!?

    Because, of course, if something is slow, spawning more threads is
    clearly the answer!

    Since you seem to desire to talk on tuning Xcode to your compilation
    needs yourself, I would suggest considering the following details
    prior to determining the appropriate # for the expert preference.

    - C, C++, ObjC or ObjC++.

    All four tend to have radically different CPU and I/O requirements.

    - if C++, STL or no?  Lots of header file magic?

    The style of C++ coding can radically change the compiler's resource
    utilization

    - precompiled headers?  Many? Few? Big? Small?

    PCHs can be massive and require much memory for the compiler to
    consume.  Or not.  Depends on your project.

    - optimization level?

    Optimizations can cause the compiler to eat CPU and/or memory.

    - doing anything else on the machine?  Expect it to be responsive at
    all?

    Compilation is in a competition for resources.  Turn up the # of
    compiler processes can lead to system unresponsiveness

    - how much memory in the system?

    Gotta balance this with the above.  Too little and 1 compiler at a
    time doing C++ will be optimal.  Boatloads o' memory -- great, but
    then you'll likely be in contention for disk I/O.

    Bottom line:  Don't turn the dial up too much.  If you do, you'll run
    out of memory and the compilers will start paging.  As soon as paging
    happens, performance will suffer hugely.

    b.bum
previous month january 2009 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Go to today