https://bugs.llvm.org/show_bug.cgi?id=33840

            Bug ID: 33840
           Summary: std::string::push_back is 3.4x slower than on
                    libstdc++
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: thomasander...@google.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

Simple program that demonstrates the issue:
----test.cpp----
#include <string>

int main(void) {
  std::string s;
  for(volatile int i = 0; i < 500000000; i++) {
    s.push_back('a');
  }
  return 0;
}
----test.cpp----

$ clang++ main.cpp -stdlib=libstdc++ && time ./a.out
real    0m2.451s
$ clang++ main.cpp -stdlib=libc++ && time ./a.out
real    0m8.535s

I've verified that it is always a constant factor of 3.4x slower than libstdc++
regardless of the input size.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to