Closed wheresrhys closed 5 years ago
Hey @wheresrhys, thanks for this. I'll check it out!
Figured it out: The regular expression which processed email addresses must have been doing a lot of backtracking on your input string. I replaced both the regexp-based html parser (#259) and email matcher (#260) with a state machine parser that runs in linear time. New output of your test driver with the changes:
src of length 1 took 0 ms
src of length 10 took 32 ms
src of length 100 took 2 ms
src of length 1000 took 3 ms
src of length 10000 took 11 ms
src of length 100000 took 98 ms
src of length 1000000 took 784 ms
Will be released in 3.0
This is now up in 3.0. Let me know if you come across any other issues, and thanks for reporting!
That sounds like an epic rewrite. Thanks a lot 🥂
It definitely was an epic rewrite! But a long time coming, and definitely needed :) Glad to help!
The following test runner demonstrates the problem