Open Bug 923651 Opened 7 years ago Updated 2 years ago

Increase default -j to more than # of cores


(Firefox Build System :: General, defect, P3)



(Not tracked)


(Reporter: gps, Unassigned)



(1 file)

With the |binaries| target, I've noticed that even during hardcore C++ compile mode that my machine isn't maxing out at 100% like I would want. It gets close - high 90's - but there's still a few percentage points on the table.

I think we should increase the default -j to #cores + 1 or #cores + 2.

I need to measure this, but I suspect +1 will be sufficient to get us closer to 100% while not incurring too much context switching.
I've always used #cores * 1.5
I'd rather not use a core # multiplier because I don't believe it will
result in much gains (we're only a few percent away from 100% during
compile) and will likely just increase context switching and system

If we had anonymous reporting of build system resource usage back to
Mozilla, would could experiment with values and choose a scientifically
proven value :)
Attachment #817382 - Flags: review?(mh+mozilla)
Assignee: nobody → gps
Comment on attachment 817382 [details] [diff] [review]
Default to building with #cores + 2

Review of attachment 817382 [details] [diff] [review]:

::: python/mozbuild/mozbuild/
@@ +407,5 @@
>          if allow_parallel:
>              if num_jobs > 0:
>                  args.append('-j%d' % num_jobs)
>              else:
> +                args.append('-j%d' % (multiprocessing.cpu_count() + 2))

#cores + 2 is huge when #cores < 3.
Attachment #817382 - Flags: review?(mh+mozilla) → review-
Priority: -- → P3
Assignee: gps → nobody
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.