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


#1

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/


#2

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


#3

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


#4

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: https://github.com/rust-lang/regex/issues/95