fgrep (isn't)

Bruce Robertson bruce at stride.UUCP
Fri Jul 12 04:34:42 AEST 1985


In article <495 at unisoft.UUCP> fnf at unisoft.UUCP writes:
>
>After grabbing the bgrep distribution off of mod.sources recently
>I decided to try a quick test of the various grep's on one our system
>V release 2 ports:
>
>		trial 1			trial 2			trial 3
>	real	user	sys	real	user	sys	real	user	sys
>	----	----	---	----	----	---	----	----	---
>
>grep	1.9	1.1	0.6	1.8	1.1	0.6	1.8	1.1	0.6
>bgrep	2.7	1.9	0.7	2.3	1.4	0.7	4.9	3.9	0.7
>egrep	3.5	2.6	0.7	3.6	2.8	0.6	3.5	2.7	0.6
>fgrep	9.6	8.8	0.7	9.7	9.0	0.6	9.8	8.9	0.7


Here are my results of the same benchmarks:

		trial 1			trial 2			trial 3
	real	user	sys	real	user	sys	real	user	sys
	----	----	---	----	----	---	----	----	---

grep	1.7	1.3	0.3	1.7	1.3	0.3	1.6	1.3	0.3
bm	0.5	0.1	0.3	0.8	0.4	0.7	1.3	0.9	0.3
egrep	1.7	1.2	0.3	1.7	1.2	0.3	1.7	1.3	0.4
fgrep	1.5	1.0	0.4	1.4	1.0	0.3	1.4	1.0	0.4

My results are more what I would expect to see.  I used bm, because I
ported that one, and not bgrep.  As you can see, bm is MUCH faster than
all of the others, and 'fgrep' is marginally faster than grep.

These were run on a Stride Micro 460 computer, which is 68000 based at 10
MHz with no wait states, running the Motorola System-V/68 version of Unix,
which is System V release 1.  The file used for the test was the first 51000
bytes of /etc/termcap.

I'm not sure why your times are so large, especially for egrep, but I'd take
a close look at your C compiler and see what code it's generating.
-- 

	Bruce Robertson
	UUCP: {ucbvax!menlo70,seismo}!unr70!unrvax!stride!bruce



More information about the Net.bugs.usg mailing list