I made a test to compare string operations in several languages for choosing a language for the server-side application. The results seemed normal until I finally tried C++,
It seems that in nodejs there are better algorithms for substring search. You can implement it by yourself and try it out.