From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 20 16:18:11 2007 Return-Path: X-Original-To: freebsd-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 4CDA516A47F for ; Wed, 20 Jun 2007 16:18:11 +0000 (UTC) (envelope-from dcross@okcupid.com) Received: from mail0.okcupid.com (mail0.okcupid.com [66.59.66.16]) by mx1.freebsd.org (Postfix) with ESMTP id 5405F13C4D1 for ; Wed, 20 Jun 2007 16:17:55 +0000 (UTC) (envelope-from dcross@okcupid.com) Received: from max.okcupid.com (max.okcupid.com [216.254.112.36]) by mail0.okcupid.com (8.13.4/8.13.4) with ESMTP id l5KGIHr3037431; Wed, 20 Jun 2007 12:18:18 -0400 (EDT) (envelope-from dcross@okcupid.com) Received: from max.okcupid.com (localhost [127.0.0.1]) by max.okcupid.com (8.13.6/8.13.6) with ESMTP id l5KGHrjn023865; Wed, 20 Jun 2007 12:17:53 -0400 (EDT) (envelope-from dcross@max.okcupid.com) X-DomainKeys: Sendmail DomainKeys Filter v0.3.3 max.okcupid.com l5KGHrjn023865 Received: from localhost (dcross@localhost) by max.okcupid.com (8.13.6/8.13.6/Submit) with ESMTP id l5KGHqiL023862; Wed, 20 Jun 2007 12:17:52 -0400 (EDT) (envelope-from dcross@max.okcupid.com) Date: Wed, 20 Jun 2007 12:17:52 -0400 (EDT) From: David Cross To: Kris Kennaway In-Reply-To: <20070620160916.GA26574@rot26.obsecurity.org> Message-ID: <20070620121351.W56928@max.okcupid.com> References: <20070620100737.S56928@max.okcupid.com> <20070620160916.GA26574@rot26.obsecurity.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Wed, 20 Jun 2007 18:29:26 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: Very slow sed... 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, 20 Jun 2007 16:18:11 -0000 On Wed, 20 Jun 2007, Kris Kennaway wrote: > On Wed, Jun 20, 2007 at 10:24:01AM -0400, David Cross wrote: > >> Machine 2: >> time sed -f >> /usr/src/gnu/usr.bin/groff/tmac/../../../../contrib/groff/tmac/strip.sed >> /usr/src/gnu/usr.bin/groff/tmac/../../../../contrib/groff/tmac/doc-common >>> /dev/null >> >> real 0m4.506s >> user 0m4.167s >> sys 0m0.000s >> >> Yes... you read that right... almost 400 _TIMES_ slower. WTF.. >> >> Where should I be looking? > > Try ktracing to see what it is doing (although sys time = 0 says it's > all in userland). So maybe gprof or pmc. Also double check the > kernel configs are identical and malloc debugging is disabled. I ktraced it, its basically just writing data, averaging about 20 bytes per write (that's how I came up with the bs= number on the dd line, trying to simulate it. I agree that it _SEEMS_ to be userland, BUT what I am suspecting is that the slowdown is in the transition between kernel and userland, but I am unsure how to check this. Kernel config is "SMP" on both. I will note its also more then just sed, the whole machine FEELs sluggish, that's just the clearest example I could show. -- David E. Cross That being said, dd SHOULD have the same problem. I will work on gprof-ing it now. > > Kris >