diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 2000-11-20 13:30:52 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-22 21:22:52 +0000 |
commit | e1901655935137420b3a46ad23c873753fcbbbc7 (patch) | |
tree | 4aa21e9df7580b0871c52221c25d109a938acdcd /pod/perlre.pod | |
parent | e97e32e6ff338f57aecf57240fd5140e51fed1f4 (diff) | |
download | perl-e1901655935137420b3a46ad23c873753fcbbbc7.tar.gz |
Overeager visited-positions optimizations
Message-ID: <20001120183051.A15228@monk.mps.ohio-state.edu>
p4raw-id: //depot/perl@7815
Diffstat (limited to 'pod/perlre.pod')
-rw-r--r-- | pod/perlre.pod | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod index 8a85241eb5..182f5bd03f 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -910,10 +910,14 @@ ways they can use backtracking to try match. For example, without internal optimizations done by the regular expression engine, this will take a painfully long time to run: - 'aaaaaaaaaaaa' =~ /((a{0,5}){0,5}){0,5}[c]/ - -And if you used C<*>'s instead of limiting it to 0 through 5 matches, -then it would take forever--or until you ran out of stack space. + 'aaaaaaaaaaaa' =~ /((a{0,5}){0,5})*[c]/ + +And if you used C<*>'s in the internal groups instead of limiting them +to 0 through 5 matches, then it would take forever--or until you ran +out of stack space. Moreover, these internal optimizations are not +always applicable. For example, if you put C<{0,5}> instead of C<*> +on the external group, no current optimization is applicable, and the +match takes a long time to finish. A powerful tool for optimizing such beasts is what is known as an "independent group", |