From owner-freebsd-stable@FreeBSD.ORG Tue Nov 23 18:51:29 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2844F16A4CE for ; Tue, 23 Nov 2004 18:51:29 +0000 (GMT) Received: from smtp005.bizmail.sc5.yahoo.com (smtp005.bizmail.sc5.yahoo.com [66.163.175.82]) by mx1.FreeBSD.org (Postfix) with SMTP id E989C43D5F for ; Tue, 23 Nov 2004 18:51:28 +0000 (GMT) (envelope-from noackjr@alumni.rice.edu) Received: from unknown (HELO optimator.noacks.org) (noackjr@supercrime.org@70.240.246.1 with login) by smtp005.bizmail.sc5.yahoo.com with SMTP; 23 Nov 2004 18:51:28 -0000 Received: from localhost (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id BB05262EE; Tue, 23 Nov 2004 12:51:27 -0600 (CST) Received: from optimator.noacks.org ([127.0.0.1]) by localhost (optimator.noacks.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18003-04-2; Tue, 23 Nov 2004 12:51:19 -0600 (CST) Received: from www.noacks.org (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id E3C376199; Tue, 23 Nov 2004 12:51:18 -0600 (CST) Received: from 69.53.57.66 (SquirrelMail authenticated user noackjr); by www.noacks.org with HTTP; Tue, 23 Nov 2004 12:51:18 -0600 (CST) Message-ID: <39182.69.53.57.66.1101235878.squirrel@69.53.57.66> In-Reply-To: <41A2C5C0.3080908@yahoo.com> References: <41A2C5C0.3080908@yahoo.com> Date: Tue, 23 Nov 2004 12:51:18 -0600 (CST) From: "Jon Noack" To: "Rob" User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: amavisd-new at noacks.org cc: freebsd-stable@freebsd.org Subject: Re: make -j$n buildworld : use of -j investigated X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: noackjr@alumni.rice.edu List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2004 18:51:29 -0000 Rob wrote: > I have tested following with FreeBSD 5.3-Stable. > > On several different PCs I have used > make -j$n buildworld > with $n ranging from 1 to 9. > > Although people suggest "-j4" as optimal in general > case, I have come to a very different conclusion: > > 1) single CPU with enough RAM (2 GHz, 512 MB) > there's no significant speed up in the range > "-j1" to "-j9". > So "-j1" is as good as "-j9". > > 2) single CPU with little RAM (333 MHz, 64 MB) > speed slows down rapidly from "-j1" to "-j9", > because of intensive swapping. > So "-j1" performs best in this case. > > 3) dual CPU with enough RAM (2 x 800 MHz, 1GB) > speed up by almost two from "-j1" to "-j2", > but after that no noticeable speed up anymore. > So "-j2" is as good as "-j9". > > ---------------------------------------- > > With these simple tests, I come to the conclusion that > "make -j$n buildworld" is best with n = number of CPUs. > Does that make sense? I believe the current recommendation for SMP machines is to use "-j(n+1)", so I've been using "-j3" on my dual CPU machines. This ensures there is always a task waiting to be executed when one of the CPUs completes a job. Note that a parallel build (using "-j") can cause problems when compiling some programs (in fact, it didn't work for the kernel last time I checked). For my UP machines I don't use "-j" at all. If you read the make(1) man page, you'll note that omitting "-j" implies "-B". As you already found, with a single CPU there is no speed gained by using "-j" and without it I get the assurance of running in compatibility mode. Jon