Comments on Top five myths about C Plus Plus

3 Comments.

People who say the STL is slow have never actually done any sort of benchmarking on it. Often, the STL is faster than hand-rolled equivalents, especially in terms of scalability, and the fact that you can create an amazingly complicated, useful, and efficient data structure with a single template invocation which just behaves correctly with a simple API (instead of having to write thousands of lines of code that you have to test and so on) makes it well worth the couple of mostly-irrelevant downsides.

My only complaint about the STL is really more to do with how compilers still can’t do template folding very well, and so tracking down what exactly the compile-time error is with a tiny template parameter mismatch can be a quite aggravating exercise.

-- fluffy 2017-09-22 06:35 UTC


People who say the STL is slow have never actually done any sort of benchmarking on it.

Heh. I suspected as much. But I really did have a lengthy argument with the authors of Yate, who insisted that they just couldn’t get enough performance out of the STL and had to write their own string class. I was skeptical, of course, but having no experience with high-performance software I couldn’t exactly contradict them.

-- Felix 2017-09-22 06:35 UTC


Oh, and usually when there’s a legitimate performance issue with STL, it’s because people are using it wrong (passing a large structure by value instead of by reference, using a completely inappropriate structure for their use case, using a crappy hash function, etc.).

-- fluffy 2017-09-22 06:36 UTC