Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54570 - in branches/release: . libs/xpressive/doc
From: eric_at_[hidden]
Date: 2009-07-01 19:01:35


Author: eric_niebler
Date: 2009-07-01 19:01:34 EDT (Wed, 01 Jul 2009)
New Revision: 54570
URL: http://svn.boost.org/trac/boost/changeset/54570

Log:
Merged revisions 54569 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r54569 | eric_niebler | 2009-07-01 15:34:09 -0700 (Wed, 01 Jul 2009) | 1 line
  
  order the tips according to their importance
........

Properties modified:
   branches/release/ (props changed)
Text files modified:
   branches/release/libs/xpressive/doc/tips_n_tricks.qbk | 23 ++++++++++++++---------
   1 files changed, 14 insertions(+), 9 deletions(-)

Modified: branches/release/libs/xpressive/doc/tips_n_tricks.qbk
==============================================================================
--- branches/release/libs/xpressive/doc/tips_n_tricks.qbk (original)
+++ branches/release/libs/xpressive/doc/tips_n_tricks.qbk 2009-07-01 19:01:34 EDT (Wed, 01 Jul 2009)
@@ -9,11 +9,17 @@
 
 Squeeze the most performance out of xpressive with these tips and tricks.
 
-[h2 Use Static Regexes]
+[h2 Compile Patterns Once And Reuse Them]
 
-On average, static regexes execute about 10 to 15% faster than their
-dynamic counterparts. It's worth familiarizing yourself with the static
-regex dialect.
+Compiling a regex (dynamic or static) is /far/ more expensive than executing a
+match or search. If you have the option, prefer to compile a pattern into
+a _basic_regex_ object once and reuse it rather than recreating it over
+and over.
+
+Since _basic_regex_ objects are not mutated by any of the regex algorithms, they
+are completely thread-safe once their initialization (and that of any grammars of
+which they are members) completes. The easiest way to reuse your patterns is
+to simply make your _basic_regex_ objects "static const".
 
 [h2 Reuse _match_results_ Objects]
 
@@ -44,12 +50,11 @@
 you can avoid this overhead by calling the regex algorithms with a `[begin, end)`
 pair.
 
-[h2 Compile Patterns Once And Reuse Them]
+[h2 Use Static Regexes]
 
-Compiling a regex (dynamic or static) is more expensive than executing a
-match or search. If you have the option, prefer to compile a pattern into
-a _basic_regex_ object once and reuse it rather than recreating it over
-and over.
+On average, static regexes execute about 10 to 15% faster than their
+dynamic counterparts. It's worth familiarizing yourself with the static
+regex dialect.
 
 [h2 Understand [^syntax_option_type::optimize]]
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk