|
|
|
|
|
by benmmurphy
1263 days ago
|
|
I think the answer is yes. See my comment here: https://news.ycombinator.com/item?id=34253876 They are repeatedly calling Regex.split on the trailing part of the string as they move across the string. Regex.split finds all the matches in the string so runs in linear time so you get a quadratic algorithm. The elixir/erlang regex implementation does not check if the string is valid utf8 before running the regex. They were getting the error because the whole string was being evaluated by the regex engine. It probably won't be as fast as the rust solution but it won't be horribly slow on large strings. |
|