Subject: Re: Othersrc grep versus GNU grep
To: Chris Pinnock <cjep@fawlty.net>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-userlevel
Date: 11/09/2003 11:06:07
Chris Pinnock wrote:
> Here are some outputs from /usr/bin/time running grep tests. The GNU grep
> is the stock GNU group in basesrc. The Othersrc grep can be found at
> in the othersrc module at cvs.netbsd.org:/cvsroot/othersrc/usr.bin/grep. 
 
Being able to ditch GNU grep would be very cool. Thanks for the work.
IMHO the difference is small enough, so it should be fine to bring
it over even now.

I note this there is huge difference in number of page reclaims
and page faults (other resource usage ~same). Perhaps that
affects the performace most?
This:

> 1. grep halibut /usr/share/dict/words
> 
> Othersrc grep version 20031108
> 
>        208  page reclaims
>        123  page faults
>
>        126  voluntary context switches
>         11  involuntary context switches
> 
> GNU grep 2.5.1 
> 
>         68  page reclaims
>          6  page faults
>
>         53  voluntary context switches
>          2  involuntary context switches
 
> 2. grep -r 386 /usr/src/sys/arch (recent NetBSD current src tree).
> 
> Othersrc grep 20031108
>
>      14520  page reclaims
>      24978  page faults
>
>      27447  voluntary context switches
>        217  involuntary context switches
> 
> GNU grep 2.5.1
> 
>       1673  page reclaims
>          6  page faults
>      25773  voluntary context switches
>        104  involuntary context switches


Could this be mmap() vs. read() ? I don't know what GNU grep
and othersrc grep uses for I/O.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you        -=-
-=- sometimes levitate or glow.   Do not let this distract you.''   -=-