From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 13 17:18:12 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 E3C0C16A400 for ; Wed, 13 Jun 2007 17:18:12 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout3.cac.washington.edu (mxout3.cac.washington.edu [140.142.32.166]) by mx1.freebsd.org (Postfix) with ESMTP id C267813C4B0 for ; Wed, 13 Jun 2007 17:18:12 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from hymn01.u.washington.edu (hymn01.u.washington.edu [140.142.8.55]) by mxout3.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.05) with ESMTP id l5DHICK0022510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 13 Jun 2007 10:18:12 -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 l5DHICnf029939 for ; Wed, 13 Jun 2007 10:18:12 -0700 X-Auth-Received: from [192.55.52.2] by hymn01.u.washington.edu via HTTP; Wed, 13 Jun 2007 10:18:12 PDT Date: Wed, 13 Jun 2007 10:18:12 -0700 (PDT) From: youshi10@u.washington.edu To: hackers@freebsd.org In-Reply-To: <20070613153555.GA4439@britannica.bec.de> 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.95533 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='SUPERLONG_LINE 0.05, NO_REAL_NAME 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0' Cc: 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 17:18:13 -0000 On Wed, 13 Jun 2007, Joerg Sonnenberger wrote: > On Wed, Jun 13, 2007 at 08:26:38AM -0700, Garrett Cooper wrote: >> Sorry -- actually I meant that (along similar lines), there was a >> program with the following lines: >> >> vsystem("/bin/chmod +x %s", filename); >> >> and I replaced it with: >> >> chmod(filename, (mode_t) ( S_IXUSR | S_IXGRP | S_IXOTH )); > > You supposedly mean stat + chmod here, right? Trivial errors like this > are easy to make. Yes ><. Good catch, thanks :). >> 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. -Garrett