How efficient is std::string compared to null-terminated strings?

前端 未结 14 2093
心在旅途
心在旅途 2020-12-28 19:23

I\'ve discovered that std::strings are very slow compared to old-fashioned null-terminated strings, so much slow that they significantly slow down my overall pr

14条回答
  •  春和景丽
    2020-12-28 20:11

    They didn't go wrong. STL implementation is generally speaking better than yours.

    I'm sure that you can write something better for a very particular case, but a factor of 2 is too much... you really must be doing something wrong.

提交回复
热议问题