Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jun 2013 11:07:54 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        Chris Rees <utisoft@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: sed query
Message-ID:  <CAJ-Vmo=xkeJ3T28W6b%2B%2BmXCiNmOngxxsQyRD3Gx1Tx1Nr3ncPg@mail.gmail.com>
In-Reply-To: <CADLo838JALaTwdSjy%2BV0JMHkbz1mD%2BezOq7a=dRzeNaSeUrDEg@mail.gmail.com>
References:  <CADLo838JALaTwdSjy%2BV0JMHkbz1mD%2BezOq7a=dRzeNaSeUrDEg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
... so run it inside hwpmc and see what the resulting CPU users are?



adrian

On 31 May 2013 07:01, Chris Rees <utisoft@gmail.com> 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=xkeJ3T28W6b%2B%2BmXCiNmOngxxsQyRD3Gx1Tx1Nr3ncPg>