]>
Commit | Line | Data |
---|---|---|
1 | [/ | |
2 | / Copyright (c) 2008 Eric Niebler | |
3 | / | |
4 | / Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | /] | |
7 | ||
8 | [section:perf Appendix 4: Performance Comparison] | |
9 | ||
10 | The performance of xpressive is competitive with _regexpp_. I have run performance | |
11 | benchmarks comparing static xpressive, dynamic xpressive and _regexpp_ on two platforms: | |
12 | gcc (Cygwin) and Visual C++. The tests include short matches and long searches. For both | |
13 | platforms, xpressive comes off well on short matches and roughly on par with _regexpp_ on | |
14 | long searches. | |
15 | ||
16 | <disclaimer> | |
17 | As with all benchmarks, | |
18 | the true test is how xpressive performs with ['your] patterns, ['your] input, and ['your] | |
19 | platform, so if performance matters in your application, it's best to run your own tests. | |
20 | </disclaimer> | |
21 | ||
22 | [section:perf_gcc xpressive vs. Boost.Regex with GCC (Cygwin)] | |
23 | ||
24 | Below are the results of a performance comparison between: | |
25 | ||
26 | * static xpressive | |
27 | * dynamic xpressive | |
28 | * _regexpp_ | |
29 | ||
30 | [variablelist Test Specifications | |
31 | [[Hardware:] [hyper-threaded 3GHz Xeon with 1Gb RAM]] | |
32 | [[Operating System:] [Windows XP Pro + Cygwin]] | |
33 | [[Compiler:] [GNU C++ version 3.4.4 (Cygwin special)]] | |
34 | [[C++ Standard Library:] [GNU libstdc++ version 3.4.4]] | |
35 | [[_regexpp_ Version:] [1.33+, BOOST_REGEX_USE_CPP_LOCALE, BOOST_REGEX_RECURSIVE]] | |
36 | [[xpressive Version:] [0.9.6a]] | |
37 | ] | |
38 | ||
39 | [h2 Comparison 1: Short Matches] | |
40 | ||
41 | The following tests evaluate the time taken to match the expression to the input string. | |
42 | For each result, the top number has been normalized relative to the fastest time, so 1.0 | |
43 | is as good as it gets. The bottom number (in parentheses) is the actual time in seconds. | |
44 | The best time has been marked in green. | |
45 | ||
46 | [xinclude ../perf/gcc/short_matches.xml] | |
47 | ||
48 | [h2 Comparison 2: Long Searches] | |
49 | ||
50 | The next test measures the time to find ['all] matches in a long English text. The text is the | |
51 | [@http://www.gutenberg.org/dirs/3/2/0/3200/3200.zip complete works of Mark Twain], | |
52 | from [@http://promo.net/pg/ Project Gutenberg]. The text is 19Mb long. As above, the top number | |
53 | is the normalized time and the bottom number is the actual time. The best time is in green. | |
54 | ||
55 | [xinclude ../perf/gcc/long_twain_search.xml] | |
56 | ||
57 | [endsect] | |
58 | [section:perf_msvc xpressive vs. Boost.Regex with Visual C++] | |
59 | ||
60 | Below are the results of a performance comparison between: | |
61 | ||
62 | * static xpressive | |
63 | * dynamic xpressive | |
64 | * _regexpp_ | |
65 | ||
66 | [variablelist Test Specifications | |
67 | [[Hardware:] [hyper-threaded 3GHz Xeon with 1Gb RAM]] | |
68 | [[Operating System:] [Windows XP Pro]] | |
69 | [[Compiler:] [Visual C++ .NET 2003 (7.1)]] | |
70 | [[C++ Standard Library:] [Dinkumware, version 313]] | |
71 | [[_regexpp_ Version:] [1.33+, BOOST_REGEX_USE_CPP_LOCALE, BOOST_REGEX_RECURSIVE]] | |
72 | [[xpressive Version:] [0.9.6a]] | |
73 | ] | |
74 | ||
75 | [h2 Comparison 1: Short Matches] | |
76 | ||
77 | The following tests evaluate the time taken to match the expression to the input string. | |
78 | For each result, the top number has been normalized relative to the fastest time, so 1.0 | |
79 | is as good as it gets. The bottom number (in parentheses) is the actual time in seconds. | |
80 | The best time has been marked in green. | |
81 | ||
82 | [xinclude ../perf/msvc/short_matches.xml] | |
83 | ||
84 | [h2 Comparison 2: Long Searches] | |
85 | ||
86 | The next test measures the time to find ['all] matches in a long English text. The text is the | |
87 | [@http://www.gutenberg.org/dirs/3/2/0/3200/3200.zip complete works of Mark Twain], | |
88 | from [@http://promo.net/pg/ Project Gutenberg]. The text is 19Mb long. As above, the top number | |
89 | is the normalized time and the bottom number is the actual time. The best time is in green. | |
90 | ||
91 | [xinclude ../perf/msvc/long_twain_search.xml] | |
92 | ||
93 | [endsect] | |
94 | [endsect] |