http://www.perlmonks.org?node_id=219882


in reply to Re: Re: Re: Re: Re: NO PERL 6
in thread NO PERL 6

Oh, OK, I see what you're talking about. No, that's not a performance issue. Named rules must be evaluated when used, of course, since otherwise we won't know what they match, and that's the expensive part. Remembering what they matched for the duration of the match is important as well for some regex optimizations I've had batted around. (And backtracking, of course--can't backtrack over a group thing without knowing its size, but that's no different than any other variable-length element) The only potential expense is the exportation of those matches, but since parrot does copy-on-write strings, that costs about two pointer stores and two integer stores.

If that overhead is excessive, you can always nudge Larry to have non-capturing rule usage.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: NO PERL 6
by John M. Dlugosz (Monsignor) on Dec 16, 2002 at 20:36 UTC
    Since the Perl 6 implementation itself will use (non-trivial) patterns to compile the script, I suppose they will be well tested and tuned.