perl regexp perform poorly if $`, $', $& are used.

This module allows you to figure out what's going on.
This commit is contained in:
espie 2007-06-04 18:37:26 +00:00
parent 7f81575155
commit 8fdb212ec3
4 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,15 @@
# $OpenBSD: Makefile,v 1.1.1.1 2007/06/04 18:37:26 espie Exp $
SHARED_ONLY= Yes
COMMENT= "assert performance of perl regexps"
MODULES= cpan
DISTNAME= Devel-SawAmpersand-0.31
CATEGORIES= devel
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (Devel-SawAmpersand-0.31.tar.gz) = KsjykPDVTrt5tujIZ/nZ9Q==
RMD160 (Devel-SawAmpersand-0.31.tar.gz) = rwa3cwHn7UR55IoiF4tfM1shYd8=
SHA1 (Devel-SawAmpersand-0.31.tar.gz) = lSAU6X6MiZp7hMtEcDS5rDMj/kw=
SHA256 (Devel-SawAmpersand-0.31.tar.gz) = xm5pbgNY+dhGxVbiCHkm8l+jEJ90e0U2xaD7VbUbSbQ=
SIZE (Devel-SawAmpersand-0.31.tar.gz) = 7302

View File

@ -0,0 +1,13 @@
The Devel::SawAmpersand module only provides one function:
$bool = Devel::SawAmpersand::sawampersand();
which is set to true if perl saw any of $`, $', $& in its code.
Devel::FindAmpersand is a bit more precise.
B::FindAmpersand is supposed to scan code to look for those variables,
but it doesn't appear to be very reliable.
Due to some design decisions, regexp matching suffers from performance
issues as soon as one of these variables is used.

View File

@ -0,0 +1,15 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2007/06/04 18:37:26 espie Exp $
${P5ARCH}/
${P5ARCH}/B/
${P5ARCH}/B/FindAmpersand.pm
${P5ARCH}/Devel/
${P5ARCH}/Devel/FindAmpersand.pm
${P5ARCH}/Devel/SawAmpersand.pm
${P5ARCH}/auto/
${P5ARCH}/auto/Devel/
${P5ARCH}/auto/Devel/SawAmpersand/
${P5ARCH}/auto/Devel/SawAmpersand/SawAmpersand.bs
${P5ARCH}/auto/Devel/SawAmpersand/SawAmpersand.so
@man man/man3p/B::FindAmpersand.3p
@man man/man3p/Devel::FindAmpersand.3p
@man man/man3p/Devel::SawAmpersand.3p