Aho-Corasick algorithm
A rather deceiving experiment.
JS native search performs better (either Regex / indexOf).
Results are displayed in console
- Algorithms can be sped up by using an array with charCode for suffix
- Only the search part is compared. Algorithm perform string replacement in one pass.
- Brute Force would perform string replacement in multiple plass. Maybe the global timing would be better
- Try other Approach (KMP / RK / BM )
- Maybe a way with regex to do one pass