[ksh93-integration-discuss] [osol-code] extremly bad performance of Solaris regex
Glenn Fowler
gsf at research.att.com
Tue Oct 30 23:31:47 PDT 2007
On Tue, 30 Oct 2007 23:07:41 -0700 Garrett D'Amore wrote:
> Don't most 3rd party software apps use a version of either GNU regex or
> perl regex?
ksh93 + ast cohorts don't
> (As a sidebar, I do recall that some time ago, I found perl's regular
> expression code, running perl, was only about 10% slower for a
> reasonably complex regular expression, compared to a hand-optimized C
> version that didn't use any regular expression library. This was
> probably about a decade ago on Sun Sparc 10 hardware... yes, that's
> sun4m I'm talking about. ;-) And the regular expression was a full match
> on HTTP log messages, as reported by the then current NCSA server.
> (Pre-Apache days... :-) I was astounded and very pleased with perl as a
> result.
the biggest drawback of perlre is that it is not posix compliant
there have been some advances in 10 years
ast regex is posix compliant, has a boyer-moore variant for fast
matching on patterns with alternations of re's with >3 char literal parts
(applied automatically using the posix api), and a <buffer,size> interface
for efficent grep-like matching over multiple lines
ast regex also has regcomp() flags for parsing sh and ksh glob patterns
the same matching machinery is used for RE's and glob patterns
there is also some perlre compatibility, but not all of its dark corners
are supported
More information about the ksh93-integration-discuss
mailing list