Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jun 2007 12:17:52 -0400 (EDT)
From:      David Cross <dcross@okcupid.com>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Very slow sed...
Message-ID:  <20070620121351.W56928@max.okcupid.com>
In-Reply-To: <20070620160916.GA26574@rot26.obsecurity.org>
References:  <20070620100737.S56928@max.okcupid.com> <20070620160916.GA26574@rot26.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help


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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070620121351.W56928>