PSA: regex! is now slower than Regex::new

It was requested that I post this here. :slight_smile: See the reddit thread for details. If you dig into the comments, there are some words about the new optimizations!

See: http://www.reddit.com/r/rust/comments/3b2i0f/psa_regex_is_now_slower_than_regexnew/

4 Likes

I know you really mean: Regex::new is awesomely much faster, surpassing regex!().

3 Likes

I hope so, I'm still figuring out whether this means regex! has gotten slower, or regex::new() has gotten faster :smiley:

It's unfortunately both. regex! lost the naive literal prefix optimization and never gain the more sophisticated one that is now in Regex::new. See: do simple literal prefix scanning in regex! ยท Issue #95 ยท rust-lang/regex ยท GitHub

1 Like