/[pcre]/code/trunk/doc/pcreperform.3
ViewVC logotype

Diff of /code/trunk/doc/pcreperform.3

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 99 by ph10, Tue Mar 6 12:27:42 2007 UTC revision 502 by ph10, Sun Mar 7 12:05:20 2010 UTC
# Line 8  Two aspects of performance are discussed Line 8  Two aspects of performance are discussed
8  time. The way you express your pattern as a regular expression can affect both  time. The way you express your pattern as a regular expression can affect both
9  of them.  of them.
10  .  .
11  .SH "MEMORY USAGE"  .SH "COMPILED PATTERN MEMORY USAGE"
12  .rs  .rs
13  .sp  .sp
14  Patterns are compiled by PCRE into a reasonably efficient byte code, so that  Patterns are compiled by PCRE into a reasonably efficient byte code, so that
15  most simple patterns do not use much memory. However, there is one case where  most simple patterns do not use much memory. However, there is one case where
16  memory usage can be unexpectedly large. When a parenthesized subpattern has a  the memory usage of a compiled pattern can be unexpectedly large. If a
17  quantifier with a minimum greater than 1 and/or a limited maximum, the whole  parenthesized subpattern has a quantifier with a minimum greater than 1 and/or
18  subpattern is repeated in the compiled code. For example, the pattern  a limited maximum, the whole subpattern is repeated in the compiled code. For
19    example, the pattern
20  .sp  .sp
21    (abc|def){2,4}    (abc|def){2,4}
22  .sp  .sp
# Line 63  pattern. Nevertheless, if the atomic gro Line 64  pattern. Nevertheless, if the atomic gro
64  speed is acceptable, this kind of rewriting will allow you to process patterns  speed is acceptable, this kind of rewriting will allow you to process patterns
65  that PCRE cannot otherwise handle.  that PCRE cannot otherwise handle.
66  .  .
67    .
68    .SH "STACK USAGE AT RUN TIME"
69    .rs
70    .sp
71    When \fBpcre_exec()\fP is used for matching, certain kinds of pattern can cause
72    it to use large amounts of the process stack. In some environments the default
73    process stack is quite small, and if it runs out the result is often SIGSEGV.
74    This issue is probably the most frequently raised problem with PCRE. Rewriting
75    your pattern can often help. The
76    .\" HREF
77    \fBpcrestack\fP
78    .\"
79    documentation discusses this issue in detail.
80    .
81    .
82  .SH "PROCESSING TIME"  .SH "PROCESSING TIME"
83  .rs  .rs
84  .sp  .sp
# Line 148  Cambridge CB2 3QH, England. Line 164  Cambridge CB2 3QH, England.
164  .rs  .rs
165  .sp  .sp
166  .nf  .nf
167  Last updated: 06 March 2007  Last updated: 07 March 2010
168  Copyright (c) 1997-2007 University of Cambridge.  Copyright (c) 1997-2010 University of Cambridge.
169  .fi  .fi

Legend:
Removed from v.99  
changed lines
  Added in v.502

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12