Thanks for your hints! I did some more testing now:
one_string /00901808/
two_string /00901808|87654321/
four_string /00901808|87654321|12345678|29586741/
2_grep_string programmed loop over list of 2 regexps
4_grep_string programmed loop over list of 4 regexps
> perl bench_regexp 100000lines.92MB.file
Benchmark: timing 1 iterations of 2_grep_string, 4_grep_string, four_s
+tring, one_string, two_string...
Matched records: 1
2_grep_string: 3 wallclock secs ( 2.91 usr + 0.44 sys = 3.35 CPU) @
+ 0.30/s (n=1)
(warning: too few iterations for a reliable count)
Matched records: 1
4_grep_string: 4 wallclock secs ( 3.56 usr + 0.42 sys = 3.98 CPU) @
+ 0.25/s (n=1)
(warning: too few iterations for a reliable count)
Matched records: 1
four_string: 100 wallclock secs (98.83 usr + 0.56 sys = 99.39 CPU) @
+ 0.01/s (n=1)
(warning: too few iterations for a reliable count)
Matched records: 1
one_string: 2 wallclock secs ( 1.62 usr + 0.40 sys = 2.02 CPU) @ 0
+.50/s (n=1)
(warning: too few iterations for a reliable count)
Matched records: 1
two_string: 75 wallclock secs (73.87 usr + 0.53 sys = 74.40 CPU) @ 0
+.01/s (n=1)
(warning: too few iterations for a reliable count)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|