Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jun 2002 16:42:20 -0400
From:      Chris Pepper <pepper@reppep.com>
To:        Mark Smith <msmith@beta.tricity.wsu.edu>
Cc:        freebsd-questions@FreeBSD.ORG, freebsd-doc@freebsd.org
Subject:   Re: make -j4 becoming default?
Message-ID:  <p05111a1db922d48366a1@[129.85.219.160]>
In-Reply-To: <200206040427.VAA18855@beta.tricity.wsu.edu>
References:  <200206040427.VAA18855@beta.tricity.wsu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
At 9:27 PM -0700 2002/06/03, Mark Smith wrote:
>  >	Obviously, I'd like to use -j4 wherever possible, and it's
>>  suboptimal to try everything multi-threaded, then sometimes fail and
>>  manually fall back to single-threaded. Even worse, I usually forget
>>  -j4 for thread-safe builds, so I waste time unnecessarily.
>
>Why?  I've tried make buildworld with different -j options and,
>on a single processor computer, they're slower than not using -jn
>at all.
>
>In this case, the handbook may be wrong.  If you have the time, try
>"time make buildworld" and "time make -j4 buildworld" in both single
>and multiuser mode and look at the "real" time for all 4. In my
>experience on my box, "make buildworld" under multiuser mode is
>the fastest.

Mark,

	It looks like you're right.

	"time make buildworld" produced these timings.

1676.438u 473.492s 38:00.61 94.2%       1420+1582k 19522+10171io 2431pf+0w
1668.499u 470.581s 37:29.41 95.0%       1425+1588k 15703+10167io 2482pf+0w

	"time make -j4 buildworld" produced these timings, so 
multi-threaded building on my 1.1GHz Celeron w/ 384mb RAM is about 
14% slower than single-threaded.

1682.883u 505.357s 43:11.26 84.4%       1403+1569k 14515+119482io 1442pf+0w
1678.557u 508.144s 43:23.59 83.9%       1403+1568k 17533+119444io 2319pf+0w


	It looks like the Handbook 
<http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html>; 
is wrong in this case. Is there general agreement that -j is useless 
on single-CPU systems? If so, I'll provide a doc patch.


						Thx,


						Chris Pepper

>Run
>
>     # make buildworld
>
>It is now possible to specify a -j option to make which will cause 
>it to spawn several simultaneous processes. This is most useful on 
>multi-CPU machines. However, since much of the compiling process is 
>IO bound rather than CPU bound it is also useful on single CPU 
>machines.
>
>On a typical single-CPU machine you would run:
>
>     # make -j4 buildworld
>
>make(1) will then have up to 4 processes running at any one time. 
>Empirical evidence posted to the mailing lists shows this generally 
>gives the best performance benefit.

-- 
Chris Pepper:               <http://www.reppep.com/~pepper/>;
Rockefeller University:        <http://www.rockefeller.edu/>;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p05111a1db922d48366a1>