From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 17 08:51:35 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 07BF016A41F; Sun, 17 Jun 2007 08:51:35 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fep01.xtra.co.nz (fep01.xtra.co.nz [210.54.141.245]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE2B13C43E; Sun, 17 Jun 2007 08:51:33 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from serv.int.fubar.geek.nz ([219.89.104.231]) by fep01.xtra.co.nz with ESMTP id <20070617083643.RYTX11149.fep01.xtra.co.nz@serv.int.fubar.geek.nz>; Sun, 17 Jun 2007 20:36:43 +1200 Date: Sun, 17 Jun 2007 20:36:40 +1200 From: Andrew Turner To: Tim Kientzle Message-ID: <20070617203640.334524fc@hermies.int.fubar.geek.nz> In-Reply-To: <4674BE32.300@freebsd.org> References: <46703EE9.1030804@freebsd.org> <4674B268.4030502@u.washington.edu> <4674BE32.300@freebsd.org> X-Mailer: Claws Mail 2.9.2 (GTK+ 2.10.13; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , 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: Sun, 17 Jun 2007 08:51:35 -0000 On Sat, 16 Jun 2007 21:53:06 -0700 Tim Kientzle wrote: > > Also, were the bottlenecks seen in pkg_delete and pkg_add, or > > does it appear to be distributed across the board? > > The biggest time sink in pkg_add is writing each file to a temp > dir then copying it to its final location. There are a couple > of strategies for avoiding this (by writing the files directly > to their final location), but it basically requires rewriting > pkg_add from scratch. I prototyped this a long time ago and > found about a 3x speedup. (Parts of that prototype eventually > became libarchive.) I've also seen a 3x speedup by using my reimplementation of pkg_add using my package management library, libpkg (http://libpkg.berlios.de). It is not production ready yet as if it fails partway through an installation it won't clean up and installed files. > I haven't looked closely at pkg_delete, but I doubt there's > much that can be done to speed it up; once you've examined the > dependency information to determine what can be deleted, > actually removing the files is a pretty straightforward > operation. I ran a quick test on installing and removing a single package with both the cvs and my own version of pkg_delete. I got a small but significant speed improvement with my implementation. The difference was too small to be noticeable by a human though (from 0.11s to 0.07s). Andrew -- Andrew Turner http://fubar.geek.nz/blog/