From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 2 18:07:55 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 79594117 for ; Sun, 2 Jun 2013 18:07:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 4239F11E9 for ; Sun, 2 Jun 2013 18:07:55 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id c11so1746427qcv.32 for ; Sun, 02 Jun 2013 11:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=SQfM4LrcJZHBlLwW/Jix4tqbnXngFij41WfLGLwjYw4=; b=Y6bEpCmQeXRiuOLAWuY1QRT5S4vlKieoCpW1UmXTj+n5XBgznTrn2UqbJfjOezY+7g EPv1SexK1tnnXZLDTOGlraAyvHlTGGSr6W7bRPIgDhSZPkYB/IQxmOBt1o/d7mXWdD5s OQwgjjoq66uaVcXHzwpKvW5ur8vTUuqTwO4ngGG7ulPPlJj5NreJhlQTQ8zaj3Wxn74S 9dyS7K6vGqXcpjbi/zY+aZJXFPCGBTfhb2RnXiRmP1SxtXf3KgxZYo+61DHp8XBQQsel pMcXlql49GTdgvB7wElcKNgyGgBRVRq7NLelu9oxu2pjhKYalnJsx0L2jr2eiXPHywVK +izA== MIME-Version: 1.0 X-Received: by 10.224.172.1 with SMTP id j1mr16070706qaz.15.1370196474818; Sun, 02 Jun 2013 11:07:54 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.71.12 with HTTP; Sun, 2 Jun 2013 11:07:54 -0700 (PDT) In-Reply-To: References: Date: Sun, 2 Jun 2013 11:07:54 -0700 X-Google-Sender-Auth: 1lrmBOjnTEgCzUvXd79Rpu1LnK4 Message-ID: Subject: Re: sed query From: Adrian Chadd To: Chris Rees Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2013 18:07:55 -0000 ... so run it inside hwpmc and see what the resulting CPU users are? adrian On 31 May 2013 07:01, Chris Rees wrote: > Hi all, > > I think I've discovered a strange behaviour of sed perhaps triggered > by the length of a regex passed to it. I noticed that a certain > expression I passed took a very long time, and suspected the usual > backtracking loop, so I started trimming it... and discovered this: > > [crees@pegasus]~% time sed -ne "s,^BitchX-[0-9][^|]*[\|]/usr/por,," > /var/db/pkg/INDEX-9 > 4.699u 0.007s 0:04.70 99.7% 40+2733k 0+0io 0pf+0w > [crees@pegasus]~% time sed -ne "s,^BitchX-[0-9][^|]*[\|]/usr/po,," > /var/db/pkg/INDEX-9 > 0.042u 0.000s 0:00.04 100.0% 48+3216k 0+0io 0pf+0w > > I've looked at the code, and can't from a brief glance figure out why > a slightly longer regex makes such a difference-- does it start to > split it? > > Chris > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"