Repository navigation
Conversation
Merging this PR will degrade performance by 9.25%2 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
This comment was marked as resolved.
This comment was marked as resolved.
b15d079 to
6bc87cc
Compare
|
Squashed into one commit and removed the issue reference from the message. |
6bc87cc to
03dec80
Compare
Closes #15775
tac -rlooked for the separator with an unanchoredRegex::find_atand then threw the match away unless it started at the current position. On a long record with no separator, each position scanned to the end of the record, so the run time grew quadratically.buffer_tac_regexnow usesregex_automata::meta::Regexand runs an anchored search at each position. The regex is built with the same syntax settings as before.TacError::InvalidRegexholds the new build error, and a small helper inerror.rskeeps the error messages unchanged.regex-automatawas already in the dependency tree throughregex.Tests:
test_regex_long_record_is_not_quadratictimes out on the old code and passes now;test_invalid_regex_error_messagespins the existing error messages.Run locally:
cargo fmt --check -p uu_tacandcargo test --locked --offline --features tac --no-default-features test_tac(35 passed). Tested on macOS (arm64).