https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77582

            Bug ID: 77582
           Summary: Improve std::string::clear performace
           Product: gcc
           Version: 6.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xiyou.wangcong at gmail dot com
  Target Milestone: ---

In !_GLIBCXX_USE_CXX11_ABI implementation, string::clear() calls _M_mutate(),
which could allocate memory as we do COW. This hurts performance when
string::clear() is on the hot path.

Reply via email to