On 09/28/2012 08:49 AM, Mike Hommey wrote:
On Fri, Sep 28, 2012 at 05:45:00PM +0200, Mike Hommey wrote:
On Fri, Sep 28, 2012 at 05:34:09PM +0200, Honza Bambas wrote:
On 9/28/2012 12:58 PM, Mike Hommey wrote:
On Fri, Sep 28, 2012 at 06:45:24AM -0400, Benoit Jacob wrote:
2012/9/28 Aryeh Gregor <a...@aryeh.name>:
On Thu, Sep 27, 2012 at 6:08 PM, Gregory Szorc <g...@mozilla.com> wrote:
I actually held out on you with the initial landing of mach: there is more
advanced tree building code in the pipes, complete with progress indicators.
However, getting it reviewed is a challenge because we want the build system
integration to be right. When that lands, mach will be smart enough to
automatically define make flags optimal for your machine. e.g. -j == # of
cores. So, you get optimal/parallel builds with no configuration necessary.
This will all be configurable, of course.
Is -j equal to number of cores really optimal? I've always been told
that it's better to set it to more like twice the number of cores,
because some fraction of threads will normally be stalled on I/O and
you don't want cores idle.
Depending on various factors, this can be offset by other factors like
cores competing for limited resources such as CPU cache. On my core i7
with 8 logical cores and 8M cache and a SSD, -j8 is fastest. More
generally while building a C++ project (C++ is computationally
expensive to compile) you're not very likely to be IO bound,
especially with a SSD. A C project might be different.
On my core i7, -j12 is fastest. bigger values are marginally slower
but they are all faster than -j8.
Mike
Win7 x64 / i7@3.9GHz / 8 cores / 12GB@1600MHz / SSD mirrored, warm
clobbered build of debug desktop browser:
-j12: 19m00s exactly
-j9: 18m45s exactly
Using more processes then cores is counter productive. I checked
this 2 years ago already when build took just 13 minutes (we
grow!!).
Conclusion: YMMV, most likely, depending on OS ; I'm on Linux. IOW, it's
better to make it configurable.
And on OSX, the same is true
http://blog.johnford.org/new-mac-builders-ssds-j-settings/
We distcc users want it higher too. In fact, I recommend using something
crazy like -j20 and using the DISTCC_HOSTS syntax to limit the number of
concurrent jobs on a per-host basis. It may even make sense when you're
only using localhost, since then the limit is global across multiple
source tree compiles.
That's theoretical, though; I haven't actually tested that out.
echo "localhost/8" > ~/.distcc/hosts # or export DISTCC_HOSTS="localhost/8"
make -j20
My current hosts file has "localhost/6 10.0.0.99/12". I have 8 virtual
cores. I limit to 6 jobs when I have a distcc server available, to keep
the build from messing up the responsiveness of my desktop. cgroups
would probably work better for that, honestly.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform