|
|
|
|
|
by tylerhou
374 days ago
|
|
Thanks for reminding me, I meant to also benchmark the interchanged version. I updated the file above with the new benchmark results. The original commenter called `find()` once per vowel, so that's why I benchmarked the regex against the less-idiomatic code. The interchanged version (loop over haystack outside, over vowels inside) is (mildly) faster than all the regex versions except for short strings & no vowels. One thing to note is that all the loop versions are not easily generalizable to non-ASCII strings, while the regex version is fairly easily. |
|