From owner-freebsd-hackers@FreeBSD.ORG Tue May 29 04:11:51 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0ADCA16A473; Tue, 29 May 2007 04:11:51 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout4.cac.washington.edu (mxout4.cac.washington.edu [140.142.33.19]) by mx1.freebsd.org (Postfix) with ESMTP id DA65613C457; Tue, 29 May 2007 04:11:50 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.33.9] (may be forged)) by mxout4.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l4T4BotN030208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 May 2007 21:11:50 -0700 X-Auth-Received: from [192.168.10.45] (c-67-166-149-71.hsd1.ca.comcast.net [67.166.149.71]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l4T4BnpU022624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 28 May 2007 21:11:49 -0700 Message-ID: <465BA81D.7060600@u.washington.edu> Date: Mon, 28 May 2007 21:12:13 -0700 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: Stephen Montgomery-Smith References: <4659EF80.70100@math.missouri.edu> <20070527223048.GA37505@icarus.home.lan> <465B0490.7080203@math.missouri.edu> <20070528212036.GA35796@freebsd.org> <465B8C51.6010806@math.missouri.edu> In-Reply-To: <465B8C51.6010806@math.missouri.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.1.294258, Antispam-Engine: 2.5.1.298604, Antispam-Data: 2007.5.28.204933 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Cc: ports@freebsd.org, Roman Divacky , hackers@freebsd.org Subject: Re: Looking for speed increases in "make index" and pkg_version for ports X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2007 04:11:51 -0000 Stephen Montgomery-Smith wrote: > Roman Divacky wrote: >> On Mon, May 28, 2007 at 11:34:24AM -0500, Stephen Montgomery-Smith wrote: >>> Jeremy Chadwick wrote: >>>> On Sun, May 27, 2007 at 03:52:16PM -0500, Stephen Montgomery-Smith >>>> wrote: >>>>> I have been thinking a lot about looking for speed increases for >>>>> "make index" and pkg_version and things like that. So for example, >>>>> in pkg_version, it calls "make -V PKGNAME" for every installed >>>>> package. Now "make -V PKGNAME" should be a speedy operation, but >>>>> the make has to load in and analyze bsd.port.mk, a quite >>>>> complicated file with about 200,000 characters in it, when all it >>>>> is needing to do is to figure out the value of the variable PKGNAME. >>>> I have a related question, pertaining to "make all-depends-list" and >>>> the >>>> utter atrocity that is the make variable ALL-DEPENDS-LIST. If you >>>> don't >>>> know what it is, look for ^ALL-DEPENDS-LIST around line 5175, in >>>> bsd.ports.mk. >>> I posted this to ports@freebsd.org, but now I am realizing that it is >>> hackers@freebsd.org that gets more responses. Anyway, here is a >>> multithreaded program "all-depends-list" that can get you double the >>> speed on dual processor systems, and even some small speed gains on >>> single processor systems. E.g. >>> >>> all-depends-list /usr/ports/x11/xorg >>> >>> http://www.math.missouri.edu/~stephen/all-depends-list.c >> >> btw.. stehpen, when are you getting a commit bit? :) I certainly hope >> that soon enough ;) > > Probably not. The program seems to have a bug in it. In particular, I > didn't read the fgetln man page sufficiently well. So think of it as a > proof of concept rather than a finished product. > > I'm going to rest from this stuff for a while, but I enjoyed the > exchanges and it has given me encouragement to work on it again in the > future sometime. > > Stephen fgetln(2) just scans ahead to the next newline, so the pointer to the next line is returned and the length of the string (with newline char included) is stored in the len variable (2nd parameter to function). -Garrett