Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 1999 15:16:54 -0500 (EST)
From:      howardjp@wam.umd.edu
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/15321: Update port:  textproc/freegrep
Message-ID:  <199912062016.PAA96968@byzantine.student.umd.edu>

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

>Number:         15321
>Category:       ports
>Synopsis:       Update port:  textproc/freegrep
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec  6 12:20:00 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     James Howard
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
University of Maryland
>Environment:

FreeBSD byzantine.student.umd.edu 4.0-CURRENT FreeBSD 4.0-CURRENT #60: Tue Nov 30 10:38:30 EST 1999     howardjp@byzantine.student.umd.edu:/usr/src/sys/compile/BYZANTINE  i386

>Description:

From the README:

This is freegrep v0.15.

At this point, comparing my code to GNU grep, searching with a standard
pattern ("-n astrian /usr/share/dict/words"), I get the following results:

	howardjp@byzantine:/usr/local/src/usr.bin/grep/grep-0.15/grep#
	/usr/bin/time ./grep astrian /usr/share/dict/words 
	134544449:alabastrian
	134544449:Lancastrian
	134544449:Zoroastrian
	134544449:Zoroastrianism
	        0.19 real         0.16 user         0.01 sys
	howardjp@byzantine:/usr/local/src/usr.bin/grep/grep-0.15/grep# 
	/usr/bin/time /usr/bin/grep -n astrian /usr/share/dict/words 
	4589:alabastrian
	103973:Lancastrian
	235689:Zoroastrian
	235690:Zoroastrianism
        	0.09 real         0.08 user         0.00 sys
	root@byzantine:/usr/local/src/usr.bin/grep/grep-0.15/grep

Therefore, I am only now 2x the runtime of GNU.

The bad news is, however, this code is getting uglier.  I now carry my own
version of Henry Spencer's regex with me.  This has been optimized in some
ways to handle grep.  Some error checking for errors I should never be
able to produce has been removed.  Spencer's prescanning has been replaced
with a tight Boyer-Moore algorithm taken from James A. Woods egrep.  I
have inlined one function by hand (trims off 2-4% of my run time).  I have
also put some prescanning into mmfgetln().  This means that the mmf*
functions now know way to much, but it knocks off 25% of my run time.

The really bad news is that a lot of options (at least -Lbclnv, probably
others) are completely broken.  I may or may not fix this during Q41999.
Expect a version 0.16 during Q12000 which at minimum fixes the breakage
and maybe more speedups.  Version 0.16 will come down the line sooner if I
get patches.

Jamie


>How-To-Repeat:

N/A

>Fix:

Here is an updated shar file.  This is not a diff because diff does
not seem to like adding a new file more than one subdirectory down.


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	freegrep
#	freegrep/files
#	freegrep/files/md5
#	freegrep/pkg
#	freegrep/pkg/COMMENT
#	freegrep/pkg/DESCR
#	freegrep/pkg/PLIST
#	freegrep/Makefile
#	freegrep/patches
#	freegrep/patches/patch-ab
#	freegrep/patches/patch-aa
#
echo c - freegrep
mkdir -p freegrep > /dev/null 2>&1
echo c - freegrep/files
mkdir -p freegrep/files > /dev/null 2>&1
echo x - freegrep/files/md5
sed 's/^X//' >freegrep/files/md5 << 'END-of-freegrep/files/md5'
XMD5 (grep-0.15.tar.gz) = bf23580b815418ccadd80459b13d0d4f
END-of-freegrep/files/md5
echo c - freegrep/pkg
mkdir -p freegrep/pkg > /dev/null 2>&1
echo x - freegrep/pkg/COMMENT
sed 's/^X//' >freegrep/pkg/COMMENT << 'END-of-freegrep/pkg/COMMENT'
XAn implementation of grep(1) under a BSD-friendly license
END-of-freegrep/pkg/COMMENT
echo x - freegrep/pkg/DESCR
sed 's/^X//' >freegrep/pkg/DESCR << 'END-of-freegrep/pkg/DESCR'
XThis is an implementation of grep(1) intended as a replacement for
XFreeBSD's GNU grep. GNU grep falls under GPL, while this implementation
Xis under a BSD-friendly licence.
END-of-freegrep/pkg/DESCR
echo x - freegrep/pkg/PLIST
sed 's/^X//' >freegrep/pkg/PLIST << 'END-of-freegrep/pkg/PLIST'
Xbin/grep
Xbin/egrep
Xbin/fgrep
Xbin/zgrep
END-of-freegrep/pkg/PLIST
echo x - freegrep/Makefile
sed 's/^X//' >freegrep/Makefile << 'END-of-freegrep/Makefile'
X# New ports collection makefile for:	grep
X# Version required:	0.15
X# Date created:		8 June 1999
X# Whom:			Sheldon Hearn <sheldonh@freebsd.org>
X#
X# $FreeBSD: ports/textproc/freegrep/Makefile,v 1.13 1999/11/05 17:53:51 cpiazza Exp $
X#
X
XDISTNAME=	grep-0.15
XPKGNAME=	freegrep-0.15
XCATEGORIES=	textproc
XMASTER_SITES=	ftp://ftp.wam.umd.edu/pub/howardjp/software/grep/ \
X		http://www.wam.umd.edu/~howardjp/software/grep/ \
X		ftp://dragon.ham.muohio.edu/pub/howardjp/software/grep/
X
XMAINTAINER=	howardjp@wam.umd.edu
X
XMAN1=	grep.1 egrep.1 fgrep.1 zgrep.1
X
XLIB_DEPENDS=	iberty.1:${PORTSDIR}/devel/freelibiberty
X
Xpost-extract:
X	@(cd ${WRKSRC}; rm -f .depend)
X
X.include <bsd.port.mk>
END-of-freegrep/Makefile
echo c - freegrep/patches
mkdir -p freegrep/patches > /dev/null 2>&1
echo x - freegrep/patches/patch-ab
sed 's/^X//' >freegrep/patches/patch-ab << 'END-of-freegrep/patches/patch-ab'
X*** regex/Makefile.orig	Mon Dec  6 12:28:53 1999
X--- regex/Makefile	Mon Dec  6 12:29:16 1999
X***************
X*** 40,45 ****
X--- 40,47 ----
X  	rm -f libregex.a
X  	ar crv libregex.a $(OBJPRODN)
X  
X+ install:
X+ 
X  purge:
X  	rm -f *.o
X  
END-of-freegrep/patches/patch-ab
echo x - freegrep/patches/patch-aa
sed 's/^X//' >freegrep/patches/patch-aa << 'END-of-freegrep/patches/patch-aa'
X*** grep/Makefile.orig	Mon Dec  6 12:27:29 1999
X--- grep/Makefile	Mon Dec  6 12:27:47 1999
X***************
X*** 9,14 ****
X--- 9,19 ----
X  	grep.1 fgrep.1 \
X  	grep.1 zgrep.1
X  
X+ DESTDIR=       ${PREFIX}
X+ BINDIR=                /bin
X+ MANDIR=                /man/man
X+ NOMANCOMPRESS= 1
X+ 
X  CFLAGS+= ${P} -I/usr/local/include -Wall -pedantic
X  
X  LDADD=  -lz -L../regex/ -lregex -L/usr/local/lib/ -liberty
END-of-freegrep/patches/patch-aa
exit




>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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