Earlier quoted context omitted.
> There isn't any point of using C++ to count words in a text file. Any high-level language like Python will beat you to it. People using c++ usually care about programs finishing before the heat death of the universe. I had a few Python scripts that spend several seconds parsing larger files, after a rewrite to c++ that changed to almost instant.
>I had a few Python scripts that spend several seconds parsing larger files, after a rewrite to c++ that changed to almost instant. Was it worth rewriting those scripts in C++? I'm not trying to be facetious; a few seconds (or minutes) of additional runtime for scripts you hardly ever run or even run only once doesn't really matter, but running such scripts often may then worth the effort to convert them to something…
Mostly for development, I ended up invoking the script quite often and had to wait for the results. In production the input it ran on only changed once a week, so there was no need to run it often.
I most likely tried to run it with Pypy first, thought I am not 100% sure on that. If I ran into a similar issue today I would first try to compile it with Cython as I already try to use type annotations in every new script I write.
> What made you pick C++ over e.g. go or rust or C#?
Most of the project was already C++ and I only had to link in an Xml library for some of the output.