bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

performance problems with grep on Pentium 3


From: Brian Mattey
Subject: performance problems with grep on Pentium 3
Date: Sun, 20 Oct 2002 14:48:23 +0100

Hi,

I'm running Red Hat Linux 8.0 with gnu grep 2.5.1-4 on a Dell PowerEdge
500SC with a 1Ghz Pentium 3 processor and 256Mb of memory.

Taking a simple text file where all the lines are of the format .

       18102002080952,07759072305,07973100973

and doing 

       time gunzip -c testfile.csv.gz | grep "^18102002" | wc -l

where all the lines will match the pattern returns a result of:

       real    0m1.358s
       user    0m1.348s
       sys     0m0.010s

Doing the same on an old Dell XPS B R450 with a 450 Mhz Pentium 2 and
256Mb memory returns .

       real    0m0.114s
       user    0m0.080s
       sys     0m0.029s

And the same on a Compaq Deskpro with a 500Mhz Pentium 2 processor and
256Mb memory returns .

       real    0m0.076s
       user    0m0.050s
       sys     0m0.020s

It gets proportionately slower on all systems the more lines are tried
but the P3 remains by far the slowest.

So it would appear that the Pentium 3 configuration is running something
like 17 times slower than the 500Mhz P2 when in fact it should be the
quickest by far.

With more data (to make it take longer) and watching a top as it goes
along grep sits at the top of list with over 97% CPU constantly and the
disk light on the machine is only flashing very intermittently - so grep
definitely looks like the culprit.

All timings are consistent on all systems when repeated and there's
nothing else running on any of the machines to make things better or
worse.

I've tried downloading the sources for grep and compiling it myself with
assorted options including "-march=pentium3" and "-O3" and the resultant
timings are pretty much the same.  I've also tried grep 2.5.1-1 with
exactly the same results.

If there's anything else you want me to try out just let me know.

Regards,

Brian Mattey






reply via email to

[Prev in Thread] Current Thread [Next in Thread]