Re: [Haskell-cafe] Haskell performance when it comes to regex?

Brandon Allbery allbery.b@gmail.com:
TDFA is pure Haskell and mostly exists for when you can't be certain that a faster C binding will support UTF8 (most POSIX regex implementations do not, and PCRE only does so if someone built it with UTF8 support). When it's usable, the C bindings will almost always be faster.
I think we are in agreement, though I would generally recommend TDFA, unless you need the highest performance (as in this case) or Perl-style REs. But then again I like my REs plain and simple (and Posix) and packages with as few external dependencies as possible. Chris

Am 30.05.2017 um 12:08 schrieb Chris Dornan:
I would generally recommend TDFA, unless you need the highest performance (as in this case) or Perl-style REs.
Just for the record: Be aware the PCRE isn't the fastest regex engine out there. It's generally good, but (a) it's doing backtracking which can make it exponentially slow, and (b) since Perl regexes have so many features, the PCRE engine cannot apply all optimizations that a highly optimized RE engine could. As always, if speed is an issue, assumptions and word of mouth need to be verified using benchmarks.
participants (2)
-
Chris Dornan
-
Joachim Durchholz