Just a thought

Rick Cooper rcooper at DWFORD.COM
Sat Mar 6 17:54:53 GMT 2004


> -----Original Message-----
> From: MailScanner mailing list
> [mailto:MAILSCANNER at JISCMAIL.AC.UK]On
> Behalf Of Julian Field
> Sent: Saturday, March 06, 2004 11:54 AM
> To: MAILSCANNER at JISCMAIL.AC.UK
> Subject: Re: Just a thought
>
>
> I thought it only made a difference for regexps that
> include variables. I
> had hoped that regexps including only static texts
> would only be compiled
> once. Anything in the Perl docs to back either of our views?

I will look into it, it's been years since perl was a primary
language for me and rusty is a kind term.. I was thinking you
don't want to precompiled expressions with var reference where
the value may change because it the change will be ignored,
perhaps I inferred it would be good for static expressions.

>
> At 16:14 06/03/2004, you wrote:
> >Julian,
> >
> >In reference to that "escape any regex characters" thing I
> >submitted that you added in the last release, it
> occurred to me
> >that while that may be more efficient that multiple
> =~ lines it
> >still has to be compiled for each line in the report you are
> >reading and, given the speed concerns already
> present,  it would
> >be much faster if it were changed to:
> >
> >s/([\(\)\[\]\.\?\*\+\^"'@<>:])/\\$1/go;
> >
> >  or better yet add:
> >my $ea = qr/([\(\)\[\]\.\?\*\+\^"'@<>:])/;
> >
> >above the while( defined($line (or add it as global
> to be used in
> >both places)
> >
> >and change the expression to:
> >s/$ea/\\$1/g;
> >
> >Might look into compiling other static expressions used in
> >looping functions to get a speed increase, and
> perhaps compiling
> >globally available expressions to be used in
> recursive functions
> >or for expressions that are repeated over and over
> within various
> >places in the various modules.. Just a thought as it
> looks like a
> >lot of the mime stuff use static regular expressions within
> >looping structures and that should drop the overhead
> of compiling
> >the expression through every iteration (if you are looking for
> >some tweaks).
> >
> >--
> >Rick Cooper
>
> --
> Julian Field
> www.MailScanner.info
> Professional Support Services at www.MailScanner.biz
> MailScanner thanks transtec Computers for their support
> PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947
> 1415 B654
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>



More information about the MailScanner mailing list