You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello.
I have met some weird problems with the latest 1.10.5 regex release.
After the upgrade I have encountered some serious performance problems with regular expressions compilation.
After hours of debugging I have noticed kinda unexpected behavior - adding regex-automata crate to Cargo.toml file somehow affects the regex performance (makes it several times worse).
MRE:
use std::time::Instant;
use regex::Regex;
fn main() {
let now = Instant::now();
for _ in 0..10000 {
Regex::new("some.regex").unwrap();
}
println!("took {}ms", now.elapsed().as_millis());
}
Cargo.toml file:
[package]
name = "testy"
version = "0.1.0"
edition = "2021"
[dependencies]
regex = "1.10.5"
regex-automata = "0.4.7" # <-- remove this guy to see the difference!
I understand that regex-automata is in the dependencies of regex. Moreover - the only thing that is changed in Cargo.lock file is the list of dependencies of the testy crate. But on my computer this program takes like 3 second without explicit regex-automata and 18 seconds with it.
The text was updated successfully, but these errors were encountered:
Hello.
I have met some weird problems with the latest 1.10.5
regex
release.After the upgrade I have encountered some serious performance problems with regular expressions compilation.
After hours of debugging I have noticed kinda unexpected behavior - adding
regex-automata
crate toCargo.toml
file somehow affects theregex
performance (makes it several times worse).MRE:
Cargo.toml file:
I understand that
regex-automata
is in the dependencies ofregex
. Moreover - the only thing that is changed inCargo.lock
file is the list of dependencies of thetesty
crate. But on my computer this program takes like 3 second without explicitregex-automata
and 18 seconds with it.The text was updated successfully, but these errors were encountered: