From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 13 21:21:01 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 D5B4316A46B; Wed, 13 Jun 2007 21:21:01 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout2.cac.washington.edu (mxout2.cac.washington.edu [140.142.33.4]) by mx1.freebsd.org (Postfix) with ESMTP id B061A13C4AE; Wed, 13 Jun 2007 21:21:01 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from hymn01.u.washington.edu (hymn01.u.washington.edu [140.142.8.55]) by mxout2.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.05) with ESMTP id l5DLL1YP004547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Jun 2007 14:21:01 -0700 Received: from localhost (localhost [127.0.0.1]) by hymn01.u.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l5DLL1vU001849; Wed, 13 Jun 2007 14:21:01 -0700 X-Auth-Received: from [192.55.52.1] by hymn01.u.washington.edu via HTTP; Wed, 13 Jun 2007 14:21:00 PDT Date: Wed, 13 Jun 2007 14:21:00 -0700 (PDT) From: youshi10@u.washington.edu To: Tim Kientzle In-Reply-To: <46703EE9.1030804@freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-PMX-Version: 5.3.1.294258, Antispam-Engine: 2.5.1.298604, Antispam-Data: 2007.6.13.140033 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='SUPERLONG_LINE 0.05, NO_REAL_NAME 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0' Cc: hackers@freebsd.org Subject: Re: Using shell commands versus C equivalents 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: Wed, 13 Jun 2007 21:21:01 -0000 On Wed, 13 Jun 2007, Tim Kientzle wrote: >>>> Next step, eliminating the linked list structure in favor or red-black >>>> trees, maybe. >>> >>> Due to the way pkg_install works, this most likely is just adding >>> complexity for no gain, it might actually slow it down. >> >> Hmmm... the only thing is that it does the linked list traversal a number of >> times per dependency. I'll take a look in gdb at the size of each dependency >> and then confer with Kirill (my mentor) about that a bit more. > > If you tend to look for the same few items over and over, > just move items to the front of the list as soon as you > find them. Alternatively, if you know you won't look for > this item ever again, move it to the end of the list or > remove it from the list entirely. > > Simple tricks like this can greatly speed things up with > almost no effort. Better yet, do easy things like this first; > if they help, then look at more complex approaches. > > As Joerg said, though, you're not likely to gain much from > this. pkg_install is almost entirely disk bound. > > I spent a lot of time recently in libarchive/bsdtar optimizing > the disk handling; I can share lots of ideas for improving > performance of disk-bound operations like this. > > Tim Kientzle Thank you Tim. I'll definitely keep that in mind :). -Garrett PS I'm looking at pkg_install and pkg_version mostly, but I'll be looking into the other package utilities closely in the next couple weeks, evaluating what approaches I should take in solving some bottlenecks with installing packages and ports. My goals are up on , and will be modified soon.