diff --git a/Cargo.lock b/Cargo.lock index c55de3dccc..43df258da9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5684,9 +5684,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "perex" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060b4682849d20ebcba05d68f9584a1bba20af4b7838c688cfb37af572f562f4" +checksum = "1542e48011813fbdf3c075da4a4ed53ee93c816eef62e36eb5064a6fd2be10a5" [[package]] name = "perry" diff --git a/Cargo.toml b/Cargo.toml index 81fc773085..8c3a08be33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -399,7 +399,7 @@ chrono = "0.4" regex = "1.12" aho-corasick = "1.1" # The single regular-expression engine, through crates/perry-perex. -perex = "0.1.3" +perex = "0.1.4" hex = "0.4" tempfile = "3" itoa = "1.0" diff --git a/changelog.d/10201-regex-perex-0.1.4.md b/changelog.d/10201-regex-perex-0.1.4.md new file mode 100644 index 0000000000..59cc1ebfff --- /dev/null +++ b/changelog.d/10201-regex-perex-0.1.4.md @@ -0,0 +1,3 @@ +### Performance + +- **Required text after a character-class repeat no longer makes each RegExp search cost its start position** (#10201). A pattern such as `/([a-z]+)([0-9]+) /g` or `/[a-z]+[0-9]+ /y` made every `exec` or `test` call over an ASCII string pay work proportional to `lastIndex`, so a loop over one string was quadratic: 21 s for 40,000 matches over a 200,000-character string. The same loop now takes 85 ms. Requires `perex` 0.1.4.