Controversial opinion time: The advantages of Thompson NFA regexes are just theoretical and not worth it. PCRE is faster in the real world.
-
-
Replying to @pcwalton
@pcwalton Russ Cox makes a pretty good case for the Thompson method here: http://bit.ly/1g2dX7s . I'm planning on writing a version in Rust.2 replies 0 retweets 0 likes -
Replying to @GraphenePunk
@graphenepunk For speed what you really need is a form that's easy to JIT. That's generally recursive backtracking.1 reply 0 retweets 1 like -
Replying to @pcwalton
@pcwalton@GraphenePunk seems like generating code for an NFA would be just as easy, if not more so. Just a bunch of labels and jumps.1 reply 0 retweets 0 likes -
-
Replying to @ssylvan
@ssylvan@graphenepunk That'd be an interesting experiment. I don't know of any benchmarks against a good JIT on non-pathological regexes.1 reply 0 retweets 0 likes -
Replying to @pcwalton
@pcwalton@GraphenePunk "pathological" regexes aren't as uncommon as you think. When it blows up, it goes nuclear, why risk that?2 replies 0 retweets 0 likes -
Replying to @ssylvan
@ssylvan@graphenepunk If it's a pathological regex just rewrite it to be not pathological.1 reply 1 retweet 0 likes -
Replying to @pcwalton @GraphenePunk
I'm curious - any change of opinion after cloudflare went down due to a pathological regex?
2 replies 0 retweets 0 likes
Is this old tweet going around suddenly?
I readily admit that @burntsushi5 showed I was wrong about performance.
Note that I was coming from experience with SpiderMonkey’s regexes, where speed of regex *compilation* dominates pretty much all else.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.