Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Regular expressions
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Sample benchmark == The benchmark consists of matching "Hello world foo=123 whereas bar=456 Goodbye" against ".*foo=([0-9]+).*bar=([0-9]+).*" (as a lazy bytestring) 1mln times (along the lines of length . filter matchesPat . replicate 1000000). It has been performed on a 2x2GHz P4 machine, compiled with -O2, ghc 6.10.1. regex-pcre: 0.02s pcre-light: 0.02s regex-tdfa 1.0.0 (no compiler bug): 0.03s regex-dfa 0.91: 5.4s regex-posix: 20s regex-tdfa 1.0.0 (most probably compiler bug): 89s In all cases, the pattern is compiled only once. WARNING: This result of 97s may be the result of a compiler bug that probably may cause the pattern to be compiled at every match invocation; without that bug, regex-tdfa performs extremely well. Please see ticket http://hackage.haskell.org/trac/ghc/ticket/3059 UNWARNING: The code for regex-tdfa 1.0.0 is being improved. In particular the slow 89s is probably real. But it need not be so. The upcoming version runs in less than 0.2 seconds. Thus, for patterns as simple as this one, it is appropriate to use pcre. For patterns where the Perl-style strategy of backtracking causes exponential backtracking blowup, it is appropriate to use regex-dfa or regex-tdfa.
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width