develooper Front page | perl.perl5.porters | Postings from May 2008

Re: bug or not? constants warn only once

Thread Previous | Thread Next
Nicholas Clark
May 5, 2008 14:40
Re: bug or not? constants warn only once
Message ID:
On Mon, May 05, 2008 at 12:13:29PM -0500, David Nicol wrote:
> On Mon, May 5, 2008 at 12:00 PM, Aristotle Pagaltzis <> wrote:
> >  the regex engine was almost twice as fast before the bookkeeping
> >  was added to detect exponential-time blowups of bad patterns.)
> how about an /f for fast regex modifier that will leave the bookkeeping out?

I'd imagine that then lots of naïve people would add it all the time (after
all, it's the "faster" flag, isn't it?) and then get bitten because they
actually wrote a bad pattern, and it went very very bad.

Whilst not familiar with the regexp code, I'd imagine that adding another
flag like this would either mean adding more complexity smeared across a lot
of the regex engine, which would mean a small slowdown for all code not
using the flag (which means all existing code), or having chunks of the
regexp engine duplicated (this one with bookkeeping, that one without)
which would increase executable size, and CPU cache pressure.

(And inevitably, more code is more maintenence, and more habitat for bugs)

Finally, as /f is not a flag that existing perls will treat as a no-op (they
will choke instead), it means that anyone starting to write code with /f
will make it (needlessly) break on any existing perl, so portable (useful)
code on CPAN can't take advantage of this. Meanwhile, code written to use it
will immediately break without a clear explanation for anyone attempting to
install it from CPAN, which isn't good for "getting your job done".

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About