Hello All,

Today I've basically terminated te feature-completion of the BSD-licensed grep from OpenBSD. It means, that I've accomplished the following tasks:
- Implement --label
- Implement --null
- Implement --color / --colour
- Implement -D / --devices
- Implement -H / --with-filename
- Implement -J / --bz2decompress
- Implement -d / --directories
- Implement -m / --max-count
- Implement -o / --only-matching
- Add --help
- Eliminate warnings
- style(9) cleanup

I've made some preliminary tests with the fgrep and normal grep behaviour and it seems that they can achieve the same speed:

/usr/bin/time -h gnugrep -e ^\#define -r /usr/include/
       24.06s real             0.11s user              0.17s sys
       24.46s real             0.11s user              0.16s sys
       24.37s real             0.11s user              0.16s sys
       23.73s real             0.09s user              0.19s sys
       23.97s real             0.06s user              0.21s sys

/usr/bin/time -h bsdgrep -e ^\#define -r /usr/include/
       23.56s real             0.27s user              0.23s sys
       23.40s real             0.28s user              0.21s sys
       23.64s real             0.30s user              0.18s sys
       23.70s real             0.30s user              0.23s sys
       23.92s real             0.28s user              0.22s sys

/usr/bin/time -h gnugrep -e int -r /usr/include/
       18.44s real             0.10s user              0.14s sys
       18.19s real             0.09s user              0.14s sys
       18.01s real             0.09s user              0.15s sys
       18.10s real             0.10s user              0.14s sys
       18.91s real             0.06s user              0.18s sys

/usr/bin/time -h bsdgrep -e int -r /usr/include/
       18.39s real             0.12s user              0.19s sys
       18.33s real             0.14s user              0.17s sys
       18.26s real             0.11s user              0.20s sys
       18.07s real             0.10s user              0.21s sys
       17.97s real             0.14s user              0.16s sys

What remains is to do more test about the performance and the compatibility with the GNU version. You can test this version easily by installing the textproc/bsdgrep port, which creates two symlinks:
bsdgrep points to this version and gnugrep points to the base grep.

Any help and comments are welcome.

Regards,
Gábor Kövedán

P.S.: Acknowledgements are going to Max Khon, who is my mentor in this program, to Diomidis Spinellis due to the his useful comments and to Sean C. Farley who worked on this implementation of grep before and provided some preliminary comments and suggestions before I started working on this project, and of course, to Google for sponsoring this piece of work.
--- Begin Message ---
gabor       2008-06-14 23:06:19 UTC

  FreeBSD ports repository

  Modified files:
    textproc/bsdgrep     Makefile distinfo 
  Log:
  - Update to 20080615
  
  This version is now supposed to be compatible with GNU grep 2.5.1, which
  can be found in FreeBSD. According to some preliminary measurements,
  they achieve almost the same level of efficiency, this version seem to be
  measureably but not significantly faster. Further tests are needed
  to test and examine this version of grep.
  
  Revision  Changes    Path
  1.5       +1 -1      ports/textproc/bsdgrep/Makefile
  1.5       +3 -3      ports/textproc/bsdgrep/distinfo

--- End Message ---
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to